Top Level Namespace
- Extended by:
- RSpecApi::Resource
Defined Under Namespace
Instance Method Summary collapse
-
#resource(name, args = {}, &block) ⇒ Object
You can also have the methods available in a RSpec Example group using ‘resource`.
Methods included from RSpecApi::Resource::Accepts
Methods included from RSpecApi::Resource::HasAttribute
Methods included from RSpecApi::Resource::Options
#adapter, #authorize_with, #host, #throttle
Instance Method Details
#resource(name, args = {}, &block) ⇒ Object
You can also have the methods available in a RSpec Example group using ‘resource`. This is the only method that RSpecApi adds to the top-level namespace and it’s equivalent to a ‘describe` block with RSpecApi::Resource:
44 45 46 47 48 49 50 |
# File 'lib/rspec-api/resource.rb', line 44 def resource(name, args = {}, &block) describe name.to_s.pluralize.humanize, args do extend RSpecApi::Resource rspec_api_resource[:resource_name] = name instance_exec &block end end |