Sha256: 73169d45eb24cbd4f01bb9c712b93d5716d9f3b5a2589308f3676190bb8fe42e

Contents?: true

Size: 610 Bytes

Versions: 2

Compression:

Stored size: 610 Bytes

Contents

module RSpec
  module GraphqlMatchers
    module HaveAFieldMatchers
      class WithProperty
        def initialize(expected_property_name)
          @expected_property_name = expected_property_name
        end

        def description
          "resolving with property `#{@expected_property_name}`"
        end

        def matches?(actual_field)
          @actual_property = actual_field.property.to_sym
          @actual_property == @expected_property_name.to_sym
        end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec-graphql_matchers-1.0.1 lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb
rspec-graphql_matchers-1.0 lib/rspec/graphql_matchers/have_a_field_matchers/with_property.rb