From b04b8b3857e31bda3ad7556c3225c7d5323b885b Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 19 Feb 2019 15:25:41 +0100 Subject: [PATCH] test building with `-except=""` --- command/build_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/command/build_test.go b/command/build_test.go index 12f9709d2..dd9bb1f43 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -102,6 +102,30 @@ func TestBuildOnlyFileMultipleFlags(t *testing.T) { } } +func TestBuildEverything(t *testing.T) { + c := &BuildCommand{ + Meta: testMetaFile(t), + } + + args := []string{ + `-except=""`, + filepath.Join(testFixture("build-only"), "template.json"), + } + + defer cleanup() + + if code := c.Run(args); code != 0 { + fatalCommand(t, c.Meta) + } + + for _, f := range []string{"chocolate.txt", "vanilla.txt", "tomato.txt", + "apple.txt", "cherry.txt", "pear.txt", "peach.txt"} { + if !fileExists(f) { + t.Errorf("Expected to find %s", f) + } + } +} + func TestBuildExceptFileCommaFlags(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t),