mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 04:20:17 +00:00
Coverage at 100%.
Model for v2 and v3 has been validated, now to build out a simple high level creation API, as well as port in 3.1 models (I think there are two). and this is ready for heavier testing.
This commit is contained in:
@@ -245,3 +245,30 @@ func TestCheckEnumForDuplicates_FailMultiple(t *testing.T) {
|
||||
yaml.Unmarshal([]byte(yml), &rootNode)
|
||||
assert.Len(t, CheckEnumForDuplicates(rootNode.Content[0].Content), 3)
|
||||
}
|
||||
|
||||
func TestExtractSpecInfo_BadVersion_OpenAPI3(t *testing.T) {
|
||||
|
||||
yml := `openapi:
|
||||
should: fail`
|
||||
|
||||
_, err := ExtractSpecInfo([]byte(yml))
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
func TestExtractSpecInfo_BadVersion_Swagger(t *testing.T) {
|
||||
|
||||
yml := `swagger:
|
||||
should: fail`
|
||||
|
||||
_, err := ExtractSpecInfo([]byte(yml))
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
func TestExtractSpecInfo_BadVersion_AsyncAPI(t *testing.T) {
|
||||
|
||||
yml := `asyncapi:
|
||||
should: fail`
|
||||
|
||||
_, err := ExtractSpecInfo([]byte(yml))
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user