Class: AutoapiTesting::ValidationErrors
- Inherits:
-
Object
- Object
- AutoapiTesting::ValidationErrors
- 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
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize ⇒ ValidationErrors
constructor
A new instance of ValidationErrors.
- #process(error) ⇒ Object
Constructor Details
#initialize ⇒ ValidationErrors
Returns a new instance of ValidationErrors.
31 32 33 |
# File 'lib/autoapi_testing.rb', line 31 def initialize @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (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 |