Class: GraphqlRails::RSpecControllerHelpers::FakeContext

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/graphql_rails/rspec_controller_helpers.rb

Overview

instance which has similar behavior as

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values:, schema:) ⇒ FakeContext

Returns a new instance of FakeContext.



70
71
72
73
74
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 70

def initialize(values:, schema:)
  @errors = []
  @provided_values = values
  @schema = schema
end

Instance Attribute Details

#schemaObject (readonly)

Returns the value of attribute schema.



66
67
68
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 66

def schema
  @schema
end

Instance Method Details

#add_error(error) ⇒ Object



76
77
78
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 76

def add_error(error)
  @errors << error
end