Skip to content

Commit 6d4536c

Browse files
authored
Update README.md
1 parent d113d6a commit 6d4536c

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ Here is how to set it up:
5656
end
5757
```
5858
2. Observe your application. You can do this in one of two ways:
59-
- Inject a Module to wrap (prepend) the `call` method of your Rack app Class.
60-
```ruby
61-
OpenapiFirst::Test.observe(MyApplication)
62-
```
63-
- Or add an `app` method to your tests, which wraps your application with silent request / response validation. (✷1)
59+
- Add an `app` method to your tests, which wraps your application with silent request / response validation. (✷1)
6460
```ruby
6561
RSpec.configure do |config|
6662
config.include OpenapiFirst::Test::Methods[MyApp], type: :request
@@ -73,6 +69,13 @@ Here is how to set it up:
7369
OpenapiFirst::Test.app(MyApp)
7470
end
7571
```
72+
- Inject a Module to wrap (prepend) the `call` method of your Rack app Class.
73+
> [!IMPORTANT]
74+
> This is still work in progress. It works with basic Sinatra apps, but does not work with Hanami or Rails out of the box, yet. PRs welcome 🤗
75+
76+
```ruby
77+
OpenapiFirst::Test.observe(MyApplication)
78+
```
7679
3. Run your tests. The Coverage feature will tell you about missing or invalid requests/responses.
7780

7881
(✷1): It does not matter what method of openapi_first you use to validate requests/responses. Instead of using `OpenapiFirstTest.app` to wrap your application, you could also use the [middlewares](#rack-middlewares) or [test assertion method](#test-assertions), but you would have to do that for all requests/responses defined in your API description to make coverage work.

0 commit comments

Comments
 (0)