...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package spec
16
17 import (
18 "encoding/json"
19 "testing"
20
21 "github.com/stretchr/testify/assert"
22 "github.com/stretchr/testify/require"
23 )
24
25 var paths = Paths{
26 VendorExtensible: VendorExtensible{Extensions: map[string]interface{}{"x-framework": "go-swagger"}},
27 Paths: map[string]PathItem{
28 "/": {
29 Refable: Refable{Ref: MustCreateRef("cats")},
30 },
31 },
32 }
33
34 const pathsJSON = `{"x-framework":"go-swagger","/":{"$ref":"cats"}}`
35
36 func TestIntegrationPaths(t *testing.T) {
37 var actual Paths
38 require.NoError(t, json.Unmarshal([]byte(pathsJSON), &actual))
39 assert.EqualValues(t, actual, paths)
40
41 assertParsesJSON(t, pathsJSON, paths)
42
43 }
44
View as plain text