@@ -25,9 +25,9 @@ func TestSwitchCommand(t *testing.T) {
2525 require .NoError (t , utils .WriteConfig (fsys , false ))
2626 // Setup target branch
2727 branch := "target"
28- branchPath := filepath .Join (filepath .Dir (utils .CurrBranchPath ), branch )
28+ branchPath := filepath .Join (filepath .Dir (utils .Paths . CurrBranchPath ), branch )
2929 require .NoError (t , fsys .Mkdir (branchPath , 0755 ))
30- require .NoError (t , afero .WriteFile (fsys , utils .CurrBranchPath , []byte ("main" ), 0644 ))
30+ require .NoError (t , afero .WriteFile (fsys , utils .Paths . CurrBranchPath , []byte ("main" ), 0644 ))
3131 // Setup mock docker
3232 require .NoError (t , apitest .MockDocker (utils .Docker ))
3333 defer gock .OffAll ()
@@ -57,15 +57,15 @@ func TestSwitchCommand(t *testing.T) {
5757 assert .NoError (t , Run (context .Background (), branch , fsys , conn .Intercept ))
5858 // Validate output
5959 assert .Empty (t , apitest .ListUnmatchedRequests ())
60- contents , err := afero .ReadFile (fsys , utils .CurrBranchPath )
60+ contents , err := afero .ReadFile (fsys , utils .Paths . CurrBranchPath )
6161 assert .NoError (t , err )
6262 assert .Equal (t , []byte (branch ), contents )
6363 })
6464
6565 t .Run ("throws error on malformed config" , func (t * testing.T ) {
6666 // Setup in-memory fs
6767 fsys := afero .NewMemMapFs ()
68- require .NoError (t , afero .WriteFile (fsys , utils .ConfigPath , []byte ("malformed" ), 0644 ))
68+ require .NoError (t , afero .WriteFile (fsys , utils .Paths . ConfigPath , []byte ("malformed" ), 0644 ))
6969 // Run test
7070 err := Run (context .Background (), "target" , fsys )
7171 // Check error
@@ -138,13 +138,13 @@ func TestSwitchCommand(t *testing.T) {
138138 JSON (container.InspectResponse {})
139139 // Setup target branch
140140 branch := "main"
141- branchPath := filepath .Join (filepath .Dir (utils .CurrBranchPath ), branch )
141+ branchPath := filepath .Join (filepath .Dir (utils .Paths . CurrBranchPath ), branch )
142142 require .NoError (t , fsys .Mkdir (branchPath , 0755 ))
143143 // Run test
144144 assert .NoError (t , Run (context .Background (), branch , fsys ))
145145 // Check error
146146 assert .Empty (t , apitest .ListUnmatchedRequests ())
147- contents , err := afero .ReadFile (fsys , utils .CurrBranchPath )
147+ contents , err := afero .ReadFile (fsys , utils .Paths . CurrBranchPath )
148148 assert .NoError (t , err )
149149 assert .Equal (t , []byte (branch ), contents )
150150 })
@@ -162,7 +162,7 @@ func TestSwitchCommand(t *testing.T) {
162162 JSON (container.InspectResponse {})
163163 // Setup target branch
164164 branch := "target"
165- branchPath := filepath .Join (filepath .Dir (utils .CurrBranchPath ), branch )
165+ branchPath := filepath .Join (filepath .Dir (utils .Paths . CurrBranchPath ), branch )
166166 require .NoError (t , fsys .Mkdir (branchPath , 0755 ))
167167 // Setup mock postgres
168168 conn := pgtest .NewConn ()
@@ -186,7 +186,7 @@ func TestSwitchCommand(t *testing.T) {
186186 JSON (container.InspectResponse {})
187187 // Setup target branch
188188 branch := "main"
189- branchPath := filepath .Join (filepath .Dir (utils .CurrBranchPath ), branch )
189+ branchPath := filepath .Join (filepath .Dir (utils .Paths . CurrBranchPath ), branch )
190190 require .NoError (t , fsys .Mkdir (branchPath , 0755 ))
191191 // Run test
192192 err := Run (context .Background (), branch , afero .NewReadOnlyFs (fsys ))
0 commit comments