Skip to content

Commit

Permalink
fix: uses implementation-agnostic phrasing for field validity definition
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zakharchenko committed Jun 5, 2019
1 parent bd7b258 commit 808ad9e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion features/expectations/body_json_example.feature
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Feature: Body - JSON example
}
"""
Then Gavel will NOT set any errors for "body"
And Gavel will set "isValid" to "true" for "body"
And field "body" is valid
And Request or Response is valid

Scenario: Extra array member in real JSON body
Expand Down
2 changes: 1 addition & 1 deletion features/expectations/body_json_schema.feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Feature: Body - JSON schema draft v4
}
"""
Then Gavel will NOT set any errors for "body"
And Gavel will set "isValid" to "true" for "body"
And field "body" is valid
And Request or Response is valid

Scenario: Payload body not valid against schema
Expand Down
2 changes: 1 addition & 1 deletion features/expectations/body_json_schemav3.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Feature: Body - JSON schema draft v3
}
"""
Then Gavel will NOT set any errors for "body"
And Gavel will set "isValid" to "true" for "body"
And field "body" is valid
And Request or Response is valid

Scenario: Payload body not valid against schema
Expand Down
6 changes: 3 additions & 3 deletions features/expectations/body_text_example.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Body - text example
Dog, cat, mouse!
"""
Then Gavel will set some error for "body"
And Gavel will set "isValid" to "false" for "body"
And field "body" is NOT valid
And Request or Response is NOT valid

Scenario: Line is changed in real textual body
Expand All @@ -39,7 +39,7 @@ Feature: Body - text example
Dog, cat, mouse!
"""
Then Gavel will set some error for "body"
And Gavel will set "isValid" to "false" for "body"
And field "body" is NOT valid
And Request or Response is NOT valid

Scenario: Text in body equals defined example
Expand All @@ -50,6 +50,6 @@ Feature: Body - text example
Dog, cat, mouse!
"""
Then Gavel will NOT set any errors for "body"
And Gavel will set "isValid" to "true" for "body"
And field "body" is valid
And Request or Response is valid

8 changes: 4 additions & 4 deletions features/expectations/headers.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: Headers
Content-Type: text/plain
"""
Then Gavel will set some error for "headers"
And Gavel will set "isValid" to "false" for "headers"
And field "headers" is NOT valid
And Request or Response is NOT valid

@stable
Expand All @@ -32,7 +32,7 @@ Feature: Headers
ETag: 68b329da9893e34099c7d8ad5cb9c940
"""
Then Gavel will NOT set any errors for "headers"
And Gavel will set "isValid" to "true" for "headers"
And field "headers" is valid
And Request or Response is valid

@stable
Expand All @@ -45,7 +45,7 @@ Feature: Headers
ETag: 68b329da9893e34099c7d8ad5cb9c940
"""
Then Gavel will set some error for "headers"
And Gavel will set "isValid" to "false" for "headers"
And field "headers" is NOT valid
And Request or Response is NOT valid

@stable
Expand All @@ -58,7 +58,7 @@ Feature: Headers
ETag: something-completely-different
"""
Then Gavel will NOT set any errors for "headers"
And Gavel will set "isValid" to "true" for "headers"
And field "headers" is valid
And Request or Response is valid


14 changes: 7 additions & 7 deletions features/expectations/method.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Feature: Method
Background:
Given you expect HTTP message method "POST"

Scenario: Different HTTP message method
When real HTTP message method is "GET"
Then Gavel will set some errors for "method"
And Gavel will set "isValid" to "false" for "method"
And Request or Response is NOT valid

Scenario: HTTP message method match
When real method is "POST"
Then Gavel will NOT set any errors for "method"
And Gavel will set "isValid" to "true" for "method"
And field "method" is valid
And Request or Response is valid

Scenario: Different HTTP message method
When real HTTP message method is "GET"
Then Gavel will set some errors for "method"
And field "method" is NOT valid
And Request or Response is NOT valid
14 changes: 7 additions & 7 deletions features/expectations/status_code.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Feature: Status code
Background:
Given you expect HTTP status code "200"

Scenario: Different real response status
When real status code is "500"
Then Gavel will set some error for "statusCode"
And Gavel will set "isValid" to "false" for "statusCode"
And Request or Response is NOT valid

Scenario: Response status code match
When real status code is "200"
Then Gavel will NOT set any errors for "statusCode"
And Gavel will set "isValid" to "true" for "statusCode"
And field "statusCode" is valid
And Request or Response is valid

Scenario: Different real response status
When real status code is "500"
Then Gavel will set some error for "statusCode"
And field "statusCode" is NOT valid
And Request or Response is NOT valid

0 comments on commit 808ad9e

Please sign in to comment.