diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-04 21:34:32 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | b64c6a3ac723b4804849bcbbd70f144640bfddd9 (patch) | |
tree | 0658ef56f5a96b6431bdfc9882c347a3d3ba8000 /pkg/gui/gui_test.go | |
parent | f76196937a6d4e5dfe86736ab06f521180a0c7ce (diff) |
this is so cool
Diffstat (limited to 'pkg/gui/gui_test.go')
-rw-r--r-- | pkg/gui/gui_test.go | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/pkg/gui/gui_test.go b/pkg/gui/gui_test.go index d0a22710a..e9bf36976 100644 --- a/pkg/gui/gui_test.go +++ b/pkg/gui/gui_test.go @@ -32,7 +32,7 @@ import ( type integrationTest struct { name string - prepare func() error + prepare func(rootDir string) error } func generateSnapshot(t *testing.T) string { @@ -61,13 +61,17 @@ func findOrCreateDir(path string) { func Test(t *testing.T) { tests := []integrationTest{ + // { + // name: "commit", + // prepare: createFixture1, + // }, + // { + // name: "squash", + // prepare: createFixture2, + // }, { - name: "commit", - prepare: createFixture1, - }, - { - name: "squash", - prepare: createFixture2, + name: "patchBuilding", + prepare: createFixture3, }, } @@ -92,13 +96,13 @@ func Test(t *testing.T) { prepareIntegrationTestDir() - err = test.prepare() + err = test.prepare(rootDir) assert.NoError(t, err) record := os.Getenv("RECORD_EVENTS") != "" runLazygit(t, replayPath, record) - updateSnapshot := os.Getenv("UPDATE_SNAPSHOT") != "" + updateSnapshot := record || os.Getenv("UPDATE_SNAPSHOT") != "" actual := generateSnapshot(t) @@ -148,6 +152,17 @@ func createFixture2() error { return runCommands(cmds) } +func createFixture3(rootDir string) error { + osCommand := oscommands.NewDummyOSCommand() + cmd := exec.Command("sh", filepath.Join(rootDir, "test", "fixtures", "1.sh")) + + if err := osCommand.RunExecutable(cmd); err != nil { + return err + } + + return nil +} + func runCommands(cmds []string) error { osCommand := oscommands.NewDummyOSCommand() |