Class: RSpec::GraphqlMatchers::AcceptArguments
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::GraphqlMatchers::AcceptArguments
- Defined in:
- lib/rspec/graphql_matchers/accept_arguments.rb
Instance Attribute Summary collapse
-
#actual_field ⇒ Object
readonly
Returns the value of attribute actual_field.
-
#expected_args ⇒ Object
readonly
Returns the value of attribute expected_args.
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(expected_args) ⇒ AcceptArguments
constructor
A new instance of AcceptArguments.
- #matches?(actual_field) ⇒ Boolean
Constructor Details
#initialize(expected_args) ⇒ AcceptArguments
Returns a new instance of AcceptArguments.
10 11 12 |
# File 'lib/rspec/graphql_matchers/accept_arguments.rb', line 10 def initialize(expected_args) @expected_args = expected_args end |
Instance Attribute Details
#actual_field ⇒ Object (readonly)
Returns the value of attribute actual_field.
8 9 10 |
# File 'lib/rspec/graphql_matchers/accept_arguments.rb', line 8 def actual_field @actual_field end |
#expected_args ⇒ Object (readonly)
Returns the value of attribute expected_args.
8 9 10 |
# File 'lib/rspec/graphql_matchers/accept_arguments.rb', line 8 def expected_args @expected_args end |
Instance Method Details
#description ⇒ Object
27 28 29 |
# File 'lib/rspec/graphql_matchers/accept_arguments.rb', line 27 def description "accept arguments #{describe_arguments(expected_args)}" end |
#failure_message ⇒ Object
22 23 24 25 |
# File 'lib/rspec/graphql_matchers/accept_arguments.rb', line 22 def "expected field '#{member_name(actual_field)}' to accept arguments "\ "#{describe_arguments(expected_args)}" end |
#matches?(actual_field) ⇒ Boolean
14 15 16 17 18 19 20 |
# File 'lib/rspec/graphql_matchers/accept_arguments.rb', line 14 def matches?(actual_field) @actual_field = actual_field @expected_args.all? do |arg_name, arg_type| matches_argument?(arg_name, arg_type) end end |