class Shoulda::Matchers::Graphql::Fields::Required

Public Class Methods

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

Public Instance Methods

description() click to toggle source
# File lib/shoulda/matchers/graphql/fields/required.rb, line 15
def description
  super + ", required"
end
failure_message() click to toggle source
# File lib/shoulda/matchers/graphql/fields/required.rb, line 19
def failure_message
  "expected '#{@subject.fields[@field_name]}' to be required, but it was not."
end
matches?(subject) click to toggle source
# File lib/shoulda/matchers/graphql/fields/required.rb, line 10
def matches?(subject)
  super(subject)
  @subject.fields[@field_name].type.class == GraphQL::Schema::NonNull
end