class RSpec::GraphqlMatchers::HaveAFieldMatchers::WithMetadata
Public Class Methods
new(expected_metadata)
click to toggle source
# File lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb, line 5 def initialize(expected_metadata) @expected_metadata = expected_metadata end
Public Instance Methods
description()
click to toggle source
# File lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb, line 9 def description "with metadata `#{@expected_metadata}`" end
failure_message()
click to toggle source
# File lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb, line 18 def failure_message "#{description}, but it was `#{@actual_metadata}`" end
matches?(actual_field)
click to toggle source
# File lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb, line 13 def matches?(actual_field) @actual_metadata = actual_field.metadata actual_field.metadata == @expected_metadata end