Skip to content

Commit

Permalink
#6 add missing test case for unset post clone cmd.
Browse files Browse the repository at this point in the history
  • Loading branch information
petr-korobeinikov committed Jan 17, 2021
1 parent 75f53b2 commit f5e1459
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internal/cfg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ func TestReadCfg(t *testing.T) {
_ = os.Setenv(`SCM_WORKSPACE_DIR`, saveScmWorkspaceDir)
})

t.Run(`unset post clone cmd`, func(t *testing.T) {
saveScmPostCloneCmdStr := os.Getenv(`SCM_POST_CLONE_CMD`)

_ = os.Unsetenv(`SCM_POST_CLONE_CMD`)
_, err := ReadCfg(`https://github.com/user/repo`)

if err != nil {
t.Error(`unset post clone cmd should not cause an error`)
}

_ = os.Setenv(`SCM_POST_CLONE_CMD`, saveScmPostCloneCmdStr)
})

t.Run(`empty post clone cmd`, func(t *testing.T) {
saveScmPostCloneCmdStr := os.Getenv(`SCM_POST_CLONE_CMD`)

Expand Down

0 comments on commit f5e1459

Please sign in to comment.