Skip to content

Commit 48c09e3

Browse files
committed
OpenapiFirst::Test.app is simpler than OpenapiFirst::Test.observe
so let's remove Test.observe from the readme for now
1 parent 5c47fd3 commit 48c09e3

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ end
1919

2020
require 'application' # Load Application code after calling OpenapiFirst::Test.setup.
2121
RSpec.configure do |config|
22-
config.include OpenapiFirst::Test::Methods[MyApp], type: :request
22+
config.include OpenapiFirst::Test::Methods[MyApp], type: :request
2323
end
2424
```
2525

@@ -61,7 +61,7 @@ Here is how to set it up:
6161
end
6262
```
6363
2. Observe your application. You can do this in multiple ways:
64-
- Add an `app` method to your tests, which wraps your application with silent request / response validation. (✷1)
64+
- Add an `app` method to your tests, which wraps your application with silent request / response validation. (✷1)
6565
```ruby
6666
module RequestSpecHelpers
6767
def app
@@ -72,22 +72,15 @@ Here is how to set it up:
7272
RSpec.configure do |config|
7373
config.include RequestSpecHelpers, type: :request
7474
end
75-
```
76-
75+
```
76+
7777
Or do this by creating a Module and including it to add an "app" method.
78-
78+
7979
```ruby
8080
RSpec.configure do |config|
8181
config.include OpenapiFirst::Test::Methods[MyApp], type: :request
8282
end
8383
```
84-
- Or modify your app to wrap the `call` method of your Rack app Class.
85-
86-
NOTE: 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 🤗
87-
88-
```ruby
89-
OpenapiFirst::Test.observe(MyApplication)
90-
```
9184
4. Run your tests. The Coverage feature will tell you about missing or invalid requests/responses.
9285

9386
(✷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)