diff --git a/subcommands/version_sc_test.go b/subcommands/version_sc_test.go index e4f17df..a841584 100644 --- a/subcommands/version_sc_test.go +++ b/subcommands/version_sc_test.go @@ -1,6 +1,7 @@ package subcommands import ( + "reflect" "testing" "github.com/everettraven/packageless/utils" @@ -28,3 +29,30 @@ func TestVersionInit(t *testing.T) { t.Fatalf("This method should do nothing except return nil | Received: %s", err) } } + +func TestVersionRun(t *testing.T) { + mockUtility := utils.NewMockUtility() + + vc := NewVersionCommand(mockUtility) + + err := vc.Init([]string{}) + + if err != nil { + t.Fatalf("This method should do nothing except return nil | Received: %s", err) + } + + err = vc.Run() + + if err != nil { + t.Fatalf("This subcommand should not return an error | Received: %s", err) + } + + callStack := []string{ + "RenderInfoMarkdown", + } + + //If the call stack doesn't match the test fails + if !reflect.DeepEqual(callStack, mockUtility.Calls) { + t.Fatalf("Call Stack does not match the expected call stack. Call Stack: %v | Expected Call Stack: %v", mockUtility.Calls, callStack) + } +}