Module: JsonapiRspec
- Included in:
- BeJsonApiResponse, BeJsonApiResponseFor
- Defined in:
- lib/jsonapi_rspec.rb,
lib/jsonapi_rspec/version.rb,
lib/jsonapi_rspec/configuration.rb
Defined Under Namespace
Classes: Configuration
Constant Summary collapse
- VERSION =
'0.2.3'.freeze
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
Instance Method Summary collapse
-
#failure_message ⇒ String
Called by RSpec when an the json:api response doesn’t match the object instance.
- #failure_message_when_negated ⇒ Object
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
10 11 12 |
# File 'lib/jsonapi_rspec.rb', line 10 def configuration @configuration end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
16 17 18 19 |
# File 'lib/jsonapi_rspec.rb', line 16 def configure self.configuration ||= Configuration.new yield(configuration) end |
.root ⇒ Object
12 13 14 |
# File 'lib/jsonapi_rspec.rb', line 12 def root Pathname.new(File.dirname(__FILE__)).parent end |
Instance Method Details
#failure_message ⇒ String
Called by RSpec when an the json:api response doesn’t match the object instance
26 27 28 |
# File 'lib/jsonapi_rspec.rb', line 26 def "#{@failure_message} - parsed response: #{pretty_response}" end |
#failure_message_when_negated ⇒ Object
30 31 32 33 |
# File 'lib/jsonapi_rspec.rb', line 30 def @failure_message = "handle method 'failure_message_when_negated' in custom_matchers.rb" "#{@failure_message}: #{pretty_response}" end |