@@ -86,38 +86,38 @@ func TestPluginContextWrite(t *testing.T) {
8686 },
8787 {
8888 doc : "table format" ,
89- context : formatter.Context {Format : NewFormat ("table" , false )},
89+ context : formatter.Context {Format : newFormat ("table" , false )},
9090 expected : `ID NAME DESCRIPTION ENABLED
9191pluginID1 foobar_baz description 1 true
9292pluginID2 foobar_bar description 2 false
9393` ,
9494 },
9595 {
9696 doc : "table format, quiet" ,
97- context : formatter.Context {Format : NewFormat ("table" , true )},
97+ context : formatter.Context {Format : newFormat ("table" , true )},
9898 expected : `pluginID1
9999pluginID2
100100` ,
101101 },
102102 {
103103 doc : "table format name col" ,
104- context : formatter.Context {Format : NewFormat ("table {{.Name}}" , false )},
104+ context : formatter.Context {Format : newFormat ("table {{.Name}}" , false )},
105105 expected : `NAME
106106foobar_baz
107107foobar_bar
108108` ,
109109 },
110110 {
111111 doc : "table format name col, quiet" ,
112- context : formatter.Context {Format : NewFormat ("table {{.Name}}" , true )},
112+ context : formatter.Context {Format : newFormat ("table {{.Name}}" , true )},
113113 expected : `NAME
114114foobar_baz
115115foobar_bar
116116` ,
117117 },
118118 {
119119 doc : "raw format" ,
120- context : formatter.Context {Format : NewFormat ("raw" , false )},
120+ context : formatter.Context {Format : newFormat ("raw" , false )},
121121 expected : `plugin_id: pluginID1
122122name: foobar_baz
123123description: description 1
@@ -132,14 +132,14 @@ enabled: false
132132 },
133133 {
134134 doc : "raw format, quiet" ,
135- context : formatter.Context {Format : NewFormat ("raw" , true )},
135+ context : formatter.Context {Format : newFormat ("raw" , true )},
136136 expected : `plugin_id: pluginID1
137137plugin_id: pluginID2
138138` ,
139139 },
140140 {
141141 doc : "custom format" ,
142- context : formatter.Context {Format : NewFormat ("{{.Name}}" , false )},
142+ context : formatter.Context {Format : newFormat ("{{.Name}}" , false )},
143143 expected : `foobar_baz
144144foobar_bar
145145` ,
@@ -156,7 +156,7 @@ foobar_bar
156156 var out bytes.Buffer
157157 tc .context .Output = & out
158158
159- err := FormatWrite (tc .context , plugins )
159+ err := formatWrite (tc .context , plugins )
160160 if err != nil {
161161 assert .Error (t , err , tc .expected )
162162 } else {
@@ -177,7 +177,7 @@ func TestPluginContextWriteJSON(t *testing.T) {
177177 }
178178
179179 out := bytes .NewBufferString ("" )
180- err := FormatWrite (formatter.Context {Format : "{{json .}}" , Output : out }, plugins )
180+ err := formatWrite (formatter.Context {Format : "{{json .}}" , Output : out }, plugins )
181181 if err != nil {
182182 t .Fatal (err )
183183 }
@@ -196,7 +196,7 @@ func TestPluginContextWriteJSONField(t *testing.T) {
196196 {ID : "pluginID2" , Name : "foobar_bar" },
197197 }
198198 out := bytes .NewBufferString ("" )
199- err := FormatWrite (formatter.Context {Format : "{{json .ID}}" , Output : out }, plugins )
199+ err := formatWrite (formatter.Context {Format : "{{json .ID}}" , Output : out }, plugins )
200200 if err != nil {
201201 t .Fatal (err )
202202 }
0 commit comments