Skip to content

Commit

Permalink
#11 changed the test to create empty files and inspect them.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami Alajrami committed Nov 16, 2017
1 parent a8c641d commit f7d9679
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ func Test_plan_execPlan(t *testing.T) {
Commands: []command{
{
Cmd: "bash",
Args: []string{"-c", "TEST='hello world'"},
Description: "Setting TEST var.",
Args: []string{"-c", "touch hello.world"},
Description: "Creating hello.world file.",
}, {
Cmd: "bash",
Args: []string{"-c", "TEST='hello world, again!'"},
Description: "Setting TEST var, again.",
Args: []string{"-c", "touch hello.world1"},
Description: "Creating hello.world1 file.",
},
},
Decisions: []string{"Set TEST var to: hello world.", "Set TEST var to: hello world, again!."},
Decisions: []string{"Create hello.world.", "Create hello.world1."},
Created: time.Now(),
},
},
Expand All @@ -151,10 +151,10 @@ func Test_plan_execPlan(t *testing.T) {
p.execPlan()
c := command{
Cmd: "bash",
Args: []string{"-c", "echo $TEST"},
Args: []string{"-c", "ls | grep hello.world | wc -l"},
Description: "",
}
if _, got := c.exec(false); strings.TrimSpace(got) != "hello world, again!" {
if _, got := c.exec(false); strings.TrimSpace(got) != "2" {
t.Errorf("execPlan(): got %v, want hello world, again!", got)
}
})
Expand Down

0 comments on commit f7d9679

Please sign in to comment.