Class: AutoapiTesting::ValidationErrors

Inherits:
Object
  • Object
show all
Defined in:
lib/autoapi_testing.rb

Overview

Track validation errors found so they can be sent to sumo after the test ends

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeValidationErrors

Returns a new instance of ValidationErrors.



31
32
33
# File 'lib/autoapi_testing.rb', line 31

def initialize
  @errors = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



30
31
32
# File 'lib/autoapi_testing.rb', line 30

def errors
  @errors
end

Instance Method Details

#process(error) ⇒ Object



35
36
37
38
39
40
# File 'lib/autoapi_testing.rb', line 35

def process(error)
  if error != true
    error.each { |e| ::Rails.logger.error("Validation error Thrown by AutoAPI rails client: \n" + e.to_s) }
    @errors.concat(error)
  end
end