Sha256: e8ec9af8055fea796d0bc9bb4bb619fde054857e292e148da7f26c15ce15675f

Contents?: true

Size: 566 Bytes

Versions: 6

Compression:

Stored size: 566 Bytes

Contents

module RSpec
  module GraphqlMatchers
    module HaveAFieldMatchers
      class WithMetadata
        def initialize(expected_metadata)
          @expected_metadata = expected_metadata
        end

        def description
          "with metadata `#{@expected_metadata}`"
        end

        def matches?(actual_field)
          @actual_metadata = actual_field.metadata
          actual_field.metadata == @expected_metadata
        end

        def failure_message
          "#{description}, but it was `#{@actual_metadata}`"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rspec-graphql_matchers-1.3.0 lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb
rspec-graphql_matchers-1.2.1 lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb
rspec-graphql_matchers-1.2 lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb
rspec-graphql_matchers-1.1 lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb
rspec-graphql_matchers-1.0.1 lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb
rspec-graphql_matchers-1.0 lib/rspec/graphql_matchers/have_a_field_matchers/with_metadata.rb