class RSpec::GraphqlAssistant::Matchers::Match

Attributes

expected[R]
key[R]
root[R]
sample[R]

Public Class Methods

new(key, expected, **args) click to toggle source
# File lib/rspec/graphql_assistant/matchers/match.rb, line 9
def initialize(key, expected, **args)
  @key = key
  @expected = expected
  @root = args.fetch(:root, :data)
end

Public Instance Methods

description() click to toggle source
# File lib/rspec/graphql_assistant/matchers/match.rb, line 25
def description
  "'#{key}' match '#{expected}'"
end
failure_message() click to toggle source
# File lib/rspec/graphql_assistant/matchers/match.rb, line 21
def failure_message
  "'#{key}' not match '#{expected}'"
end
matches?(actual) click to toggle source
# File lib/rspec/graphql_assistant/matchers/match.rb, line 15
def matches?(actual)
  value = lookup_value(actual)

  value == expected
end