1111require 'rspec-api/matchers/status/have_status'
1212
1313module RSpecApi
14+ # Provides RSpec Matchers for RESTful web APIs.
15+ #
16+ # To have these matchers available inside of an RSpec `describe` block,
17+ # tag that block with the `:rspec_api` metadata, or explicitly include the
18+ # RSpecApi::Matchers module inside the example group
19+ #
20+ # @example Tag a `describe` block as `:rspec_api`:
21+ # describe "Artists", rspec_api: true do
22+ # ... # here you can write `expect(response).to have_status :ok`, etc.
23+ # end
24+ #
25+ # @example Explicitly include the RSpecApi::Matchers module
26+ # describe "Artists" do
27+ # include RSpecApi::Matchers
28+ # ... # here you can write `expect(response).to have_status :ok`, etc.
29+ # end
1430 module Matchers
1531 include Attributes
1632 include Collection
@@ -25,20 +41,4 @@ module Matchers
2541 end
2642end
2743
28- # RSpecApi::Matchers adds matchers to test RESTful APIs.
29- #
30- # To have these matchers available inside of an RSpec `describe` block, tag that
31- # block with the `:rspec_api` metadata:
32- #
33- # describe "Artists", rspec_api: true do
34- # ... # here you can write `expect(response).to have_status :ok`, etc.
35- # end
36- RSpec . configuration . include RSpecApi ::Matchers , rspec_api : true
37-
38- # You can also explicitly include the RSpec::Api module inside the example group:
39- #
40- # describe "Artists" do
41- # include RSpecApi::Matchers
42- # ... # here you can write `expect(response).to have_status :ok`, etc.
43- # end
44- #
44+ RSpec . configuration . include RSpecApi ::Matchers , rspec_api : true
0 commit comments