From 2d6f1b5b9e7e3955eae9a7d70ef7a5fe4f69c013 Mon Sep 17 00:00:00 2001 From: Gurarpit Singh Date: Sun, 10 Nov 2019 00:05:01 +0000 Subject: [PATCH] add additional tfvalidate tests --- plugin_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugin_test.go b/plugin_test.go index 42a2df0..4159d49 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -107,12 +107,28 @@ func TestPlugin(t *testing.T) { g.Describe("tfValidate", func() { g.It("Should return correct validate command", func() { + type args struct { + config Config + } + tests := []struct { name string + args args want *exec.Cmd }{ { "default", + args{config: Config{VarFiles: []string{"common.tfvars", "prod.tfvars"}}}, + exec.Command("terraform", "validate"), + }, + { + "with no vars", + args{config: Config{Vars: map[string]string{"var1": "value1", "var2": "value2"}}}, + exec.Command("terraform", "validate"), + }, + { + "with no var-files", + args{config: Config{VarFiles: []string{"common.tfvars", "prod.tfvars"}}}, exec.Command("terraform", "validate"), }, }