You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/cli/test/e2e/cli/merge_test.go
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,32 @@ func TestMerge(t *testing.T) {
38
38
assert.Contains(t, o.String(), "\"ApiError\":")
39
39
})
40
40
41
+
t.Run("Merge valid specs to yaml", func(t*testing.T) {
42
+
base, err:=NewBaseSpec()
43
+
require.NoError(t, err)
44
+
external, err:=NewAPIRegistrySpec()
45
+
require.NoError(t, err)
46
+
47
+
cmd:=exec.Command(cliPath,
48
+
"merge",
49
+
"-b",
50
+
base,
51
+
"-e",
52
+
external,
53
+
"-f",
54
+
"yaml",
55
+
)
56
+
57
+
varo, e bytes.Buffer
58
+
cmd.Stdout=&o
59
+
cmd.Stderr=&e
60
+
require.NoError(t, cmd.Run(), e.String())
61
+
62
+
assert.Contains(t, o.String(), "\"openapi\"")
63
+
assert.Contains(t, e.String(), "We silently resolved the conflict with the schemas \"ApiError\" because the definition was identical") //nolint:lll // Line is over 120 characters
64
+
assert.Contains(t, o.String(), "\"ApiError\":")
65
+
})
66
+
41
67
t.Run("Expecting Error: Merge duplicated path with base spec", func(t*testing.T) {
0 commit comments