class Shoulda::Matchers::Graphql::Fields::WithDescription

Public Class Methods

new(field_name, field_description) click to toggle source
# File lib/shoulda/matchers/graphql/fields/with_description.rb, line 6
def initialize(field_name, field_description)
  super(field_name)
  @field_description = field_description
end

Public Instance Methods

description() click to toggle source
# File lib/shoulda/matchers/graphql/fields/with_description.rb, line 16
def description
  super + ", with description #@field_description"
end
failure_message() click to toggle source
# File lib/shoulda/matchers/graphql/fields/with_description.rb, line 20
def failure_message
  "expected the field_description to be '#@field_description', but it was '#{subject_description}' instead."
end
matches?(subject) click to toggle source
# File lib/shoulda/matchers/graphql/fields/with_description.rb, line 11
def matches?(subject)
  super(subject)
  subject_description.to_s == @field_description.to_s
end
subject_description() click to toggle source
# File lib/shoulda/matchers/graphql/fields/with_description.rb, line 24
def subject_description
  @subject.fields[@field_name].description
end