Sha256: 7f7a4424fc24e86b125b16420fb219458d680db5b33195ac1632506e27ab4085

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

module RSpec
  module GraphqlMatchers
    class BaseMatcher
      private

      def member_name(member)
        member.respond_to?(:graphql_name) && member.graphql_name ||
          member.respond_to?(:name) && member.name ||
          member.inspect
      end

      def types_match?(actual_type, expected_type)
        actual_type = actual_type.to_graphql if actual_type.respond_to?(:to_graphql)
        expected_type = expected_type.to_graphql if expected_type.respond_to?(:to_graphql)

        expected_type.nil? || expected_type.to_s == actual_type.to_s
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-graphql_matchers-1.0.0.pre.0.1 lib/rspec/graphql_matchers/base_matcher.rb