Class: RSpec::GraphqlMatchers::HaveAFieldMatchers::WithProperty
- Inherits:
-
Object
- Object
- RSpec::GraphqlMatchers::HaveAFieldMatchers::WithProperty
- Defined in:
- lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(expected_property_name) ⇒ WithProperty
constructor
A new instance of WithProperty.
- #matches?(actual_field) ⇒ Boolean
Constructor Details
#initialize(expected_property_name) ⇒ WithProperty
Returns a new instance of WithProperty.
5 6 7 |
# File 'lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb', line 5 def initialize(expected_property_name) @expected_property_name = expected_property_name end |
Instance Method Details
#description ⇒ Object
9 10 11 |
# File 'lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb', line 9 def description "resolving with property `#{@expected_property_name}`" end |
#failure_message ⇒ Object
18 19 20 |
# File 'lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb', line 18 def "#{description}, but it was `#{@actual_property}`" end |
#matches?(actual_field) ⇒ Boolean
13 14 15 16 |
# File 'lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb', line 13 def matches?(actual_field) @actual_property = actual_field.property.to_sym @actual_property == @expected_property_name.to_sym end |