diff --git a/cmd/document/pull_test.go b/cmd/document/pull_test.go index e590f8cd9..cc131168d 100644 --- a/cmd/document/pull_test.go +++ b/cmd/document/pull_test.go @@ -17,46 +17,19 @@ package document import ( "testing" - fixtures "github.com/go-git/go-git-fixtures/v4" - - "opendev.org/airship/airshipctl/pkg/config" - "opendev.org/airship/airshipctl/pkg/environment" "opendev.org/airship/airshipctl/testutil" ) -func getDummyAirshipSettings() *environment.AirshipCTLSettings { - settings := &environment.AirshipCTLSettings{Config: testutil.DummyConfig(), Create: true} - - fx := fixtures.Basic().One() - - mfst := settings.Config.Manifests["dummy_manifest"] - mfst.Repositories = map[string]*config.Repository{ - "primary": { - URLString: fx.DotGit().Root(), - CheckoutOptions: &config.RepoCheckout{ - Branch: "master", - ForceCheckout: false, - }, - Auth: &config.RepoAuth{ - Type: "http-basic", - }, - }, - } - return settings -} - func TestPull(t *testing.T) { cmdTests := []*testutil.CmdTest{ { - Name: "document-pull-cmd", - CmdLine: "", - Cmd: NewPullCommand(getDummyAirshipSettings()), + Name: "document-pull-cmd-with-help", + CmdLine: "--help", + Cmd: NewPullCommand(nil), }, } for _, tt := range cmdTests { testutil.RunTest(t, tt) } - - testutil.CleanUpGitFixtures(t) } diff --git a/cmd/document/testdata/TestPullGoldenOutput/document-pull-cmd-with-help.golden b/cmd/document/testdata/TestPullGoldenOutput/document-pull-cmd-with-help.golden new file mode 100644 index 000000000..b618d9ded --- /dev/null +++ b/cmd/document/testdata/TestPullGoldenOutput/document-pull-cmd-with-help.golden @@ -0,0 +1,7 @@ +Pulls documents from remote git repository + +Usage: + pull [flags] + +Flags: + -h, --help help for pull diff --git a/cmd/document/testdata/TestPullGoldenOutput/document-pull-cmd.golden b/cmd/document/testdata/TestPullGoldenOutput/document-pull-cmd.golden deleted file mode 100644 index e69de29bb..000000000