Skip to content

Commit 0837b26

Browse files
committed
Update Changelog,Readme
1 parent adb4d52 commit 0837b26

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# Changelog
22

33
## Unreleased
4-
- Add `OpenapiFirst::Test::Configuration#ignored_unknown_status` to configure response status(es) that do not have to be descriped in the API description.
5-
- Change `OpenapiFirst::Test` to make tests fail if API description is not covered by tests. You can adapt this behavior via `OpenapiFirst::Test.setup` / `skip_response_coverage_if` or deactivate coverage with `report_coverage = false` or `report_coverage = :warn`
4+
5+
OpenapiFirst::Test is stricter and more configurable:
6+
- Added `OpenapiFirst::Test::Configuration#ignored_unknown_status` to configure response status(es) that do not have to be descriped in the API description.
7+
- Changed `OpenapiFirst::Test` to make tests fail if API description is not covered by tests. You can adapt this behavior via `OpenapiFirst::Test.setup` / `skip_response_coverage` or deactivate coverage with `report_coverage = false` or `report_coverage = :warn`
68
- Added `OpenapiFirst::Test::Configuration#report_coverage=` to configure the behavior if not all requests/responses of the API under test have been tested.
7-
- Deprecate `OpenapiFirst::Test::Configuration#minimum_coverage=` use "#report_coverage" instead to modify the behavior
8-
- OpenapiFirst::Test now raises an "invalid response" error if it sees an invalid response.
9-
You can change this back to the old behavior by setting `response_raise_error = false`:
10-
```ruby
11-
OpenapiFirst::Test.setup do |test|
12-
# test.register(...)
13-
test.response_raise_error = false
14-
end
15-
```
9+
- Deprecated `OpenapiFirst::Test::Configuration#minimum_coverage=` use "#report_coverage=true/false/:info" instead to modify the behavior
10+
- Changed OpenapiFirst::Test to raises an "invalid response" error if it sees an invalid response (https://github.com/ahx/openapi_first/issues/366).
11+
You can change this back to the old behavior by setting `response_raise_error = false` (but you shouldn't).
1612

1713
## 2.7.4
1814

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Here is how to set it up:
3838
OpenapiFirst::Test.setup do |config|
3939
config.register('openapi/openapi.yaml')
4040
# Optional: Skip certain responses, which are described in your API description, but need no test coverage
41-
config.skip_response_coverage_if { |response_definition| response_definition.status.to_s == '500' }
41+
config.skip_response_coverage { |response_definition| response_definition.status.to_s == '500' }
4242
end
4343
```
4444
2. Add an `app` method to your tests by including a Module. This `app` method wraps your application with silent request / response validation. This validates all requests/responses in your test run. (✷1)

0 commit comments

Comments
 (0)