diff --git a/command/build_test.go b/command/build_test.go index 53043a2d4..2a2ba1734 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -28,7 +28,7 @@ func TestBuildOnlyFileCommaFlags(t *testing.T) { } for _, f := range []string{"chocolate.txt", "vanilla.txt", - "apple.txt", "peach.txt", "pear.txt"} { + "apple.txt", "peach.txt", "pear.txt", "unnamed.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } @@ -62,7 +62,8 @@ func TestBuildStdin(t *testing.T) { fatalCommand(t, c.Meta) } - for _, f := range []string{"vanilla.txt", "cherry.txt", "chocolate.txt"} { + for _, f := range []string{"vanilla.txt", "cherry.txt", "chocolate.txt", + "unnamed.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } @@ -95,7 +96,7 @@ func TestBuildOnlyFileMultipleFlags(t *testing.T) { } } for _, f := range []string{"chocolate.txt", "cherry.txt", - "apple.txt", "peach.txt", "pear.txt"} { + "apple.txt", "peach.txt", "pear.txt", "unnamed.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } @@ -108,7 +109,7 @@ func TestBuildEverything(t *testing.T) { } args := []string{ - `-except=""`, + `-except=`, filepath.Join(testFixture("build-only"), "template.json"), } @@ -119,7 +120,7 @@ func TestBuildEverything(t *testing.T) { } for _, f := range []string{"chocolate.txt", "vanilla.txt", "tomato.txt", - "apple.txt", "cherry.txt", "pear.txt", "peach.txt"} { + "apple.txt", "cherry.txt", "pear.txt", "peach.txt", "unnamed.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } @@ -142,7 +143,8 @@ func TestBuildExceptFileCommaFlags(t *testing.T) { fatalCommand(t, c.Meta) } - for _, f := range []string{"chocolate.txt", "vanilla.txt", "tomato.txt"} { + for _, f := range []string{"chocolate.txt", "vanilla.txt", "tomato.txt", + "unnamed.txt"} { if fileExists(f) { t.Errorf("Expected NOT to find %s", f) } @@ -198,4 +200,5 @@ func cleanup() { os.RemoveAll("peach.txt") os.RemoveAll("pear.txt") os.RemoveAll("tomato.txt") + os.RemoveAll("unnamed.txt") } diff --git a/command/test-fixtures/build-only/template.json b/command/test-fixtures/build-only/template.json index 9ca20adca..01e6bfd13 100644 --- a/command/test-fixtures/build-only/template.json +++ b/command/test-fixtures/build-only/template.json @@ -48,6 +48,15 @@ "type": "shell-local", "inline": [ "touch tomato.txt" ] } + ], + [ + { + "only": [ + "chocolate" + ], + "type": "shell-local", + "inline": [ "touch unnamed.txt" ] + } ] ] } \ No newline at end of file