@@ -24,7 +24,7 @@ func TestSetCICDOrigin(t *testing.T) {
2424 err := s .SetCICDOrigin (newOrigin )
2525 testenv .CheckForErrors (t , err )
2626
27- stdout , err := local .Do ("git remote get-url origin" )
27+ stdout , _ , err := local .Do ("git remote get-url origin" )
2828 testenv .CheckForErrors (t , err )
2929 if strings .TrimSpace (stdout .String ()) != newOrigin {
3030 t .Errorf ("origin should be %s but is %s" , newOrigin , stdout .String ())
@@ -109,3 +109,50 @@ func TestFetch(t *testing.T) {
109109 t .Errorf ("branch should be '%s' but is '%s'" , local2Branch , branchName )
110110 }
111111}
112+
113+ func TestStash (t * testing.T ) {
114+ local , _ , teardown := testenv .SetupEnv (t )
115+ defer teardown ()
116+
117+ s := setupNativeGitService (local .Folder )
118+ local .Do ("touch test.file" )
119+ stdout , _ , _ := local .Do ("git status | grep test.file" )
120+ if stdout .String () == "" {
121+ t .Errorf ("testfile lookup should NOT be empty" )
122+ }
123+
124+ s .AddAll ()
125+ s .Stash ()
126+
127+ stdout , _ , _ = local .Do ("git status | grep test.file" )
128+ if stdout .String () != "" {
129+ t .Errorf ("testfile lookup should be empty" )
130+ }
131+ }
132+
133+ func TestStashPop (t * testing.T ) {
134+ local , _ , teardown := testenv .SetupEnv (t )
135+ defer teardown ()
136+
137+ s := setupNativeGitService (local .Folder )
138+ local .Do ("touch test.file" )
139+ stdout , _ , _ := local .Do ("git status | grep test.file" )
140+ if stdout .String () == "" {
141+ t .Errorf ("testfile lookup should NOT be empty" )
142+ }
143+
144+ s .AddAll ()
145+ s .Stash ()
146+
147+ stdout , _ , _ = local .Do ("git status | grep test.file" )
148+ if stdout .String () != "" {
149+ t .Errorf ("testfile lookup should be empty" )
150+ }
151+
152+ s .StashPop ()
153+
154+ stdout , _ , _ = local .Do ("git status | grep test.file" )
155+ if stdout .String () == "" {
156+ t .Errorf ("testfile lookup should NOT be empty" )
157+ }
158+ }
0 commit comments