File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -91,11 +91,17 @@ func Test_viewRun(t *testing.T) {
9191 wantErr bool
9292 }{
9393 {
94- name : "no such gist" ,
94+ name : "no such gist" ,
95+ opts : & ViewOptions {
96+ Selector : "1234" ,
97+ },
9598 wantErr : true ,
9699 },
97100 {
98101 name : "one file" ,
102+ opts : & ViewOptions {
103+ Selector : "1234" ,
104+ },
99105 gist : & shared.Gist {
100106 Files : map [string ]* shared.GistFile {
101107 "cicada.txt" : {
@@ -109,6 +115,7 @@ func Test_viewRun(t *testing.T) {
109115 {
110116 name : "filename selected" ,
111117 opts : & ViewOptions {
118+ Selector : "1234" ,
112119 Filename : "cicada.txt" ,
113120 },
114121 gist : & shared.Gist {
@@ -127,6 +134,9 @@ func Test_viewRun(t *testing.T) {
127134 },
128135 {
129136 name : "multiple files, no description" ,
137+ opts : & ViewOptions {
138+ Selector : "1234" ,
139+ },
130140 gist : & shared.Gist {
131141 Files : map [string ]* shared.GistFile {
132142 "cicada.txt" : {
@@ -143,6 +153,9 @@ func Test_viewRun(t *testing.T) {
143153 },
144154 {
145155 name : "multiple files, description" ,
156+ opts : & ViewOptions {
157+ Selector : "1234" ,
158+ },
146159 gist : & shared.Gist {
147160 Description : "some files" ,
148161 Files : map [string ]* shared.GistFile {
@@ -161,7 +174,8 @@ func Test_viewRun(t *testing.T) {
161174 {
162175 name : "raw" ,
163176 opts : & ViewOptions {
164- Raw : true ,
177+ Selector : "1234" ,
178+ Raw : true ,
165179 },
166180 gist : & shared.Gist {
167181 Description : "some files" ,
@@ -217,10 +231,6 @@ func Test_viewRun(t *testing.T) {
217231 io .SetStdoutTTY (true )
218232 tt .opts .IO = io
219233
220- if tt .opts .Selector == "" {
221- tt .opts .Selector = "1234"
222- }
223-
224234 t .Run (tt .name , func (t * testing.T ) {
225235 err := viewRun (tt .opts )
226236 if tt .wantErr {
You can’t perform that action at this time.
0 commit comments