Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Remove unwanted code #15

Merged
merged 8 commits into from Mar 15, 2024
22 changes: 0 additions & 22 deletions tools/cli/internal/cli/merge/merge_test.go
Expand Up @@ -20,7 +20,6 @@ import (

"github.com/getkin/kin-openapi/openapi3"
"github.com/mongodb/openapi/tools/cli/internal/cli/flag"
"github.com/mongodb/openapi/tools/cli/internal/cli/validator"
"github.com/mongodb/openapi/tools/cli/internal/openapi"
"github.com/spf13/afero"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -71,27 +70,6 @@ func TestNoBaseSpecMerge_PreRun(t *testing.T) {
"Please, use the flag %s to include the base OAS", flag.Base))
}

func TestNoExternalSpecMerge_PreRun(t *testing.T) {
opts := &Opts{
outputPath: "foas.json",
basePath: "base.json",
}

err := opts.PreRunE(nil)
require.Error(t, err)
require.EqualError(t, err, fmt.Sprintf("no external OAS detected. "+
"Please, use the flag %s to include at least one OAS", flag.External))
}

func TestCreateBuilder(t *testing.T) {
validator.ValidateSubCommandsAndFlags(
t,
Builder(),
0,
[]string{flag.Base, flag.External, flag.Output},
)
}

func TestOpts_PreRunE(t *testing.T) {
testCases := []struct {
wantErr require.ErrorAssertionFunc
Expand Down