Class: GovukContentSchemaTestHelpers::ValidationErrorMessage
- Inherits:
-
Object
- Object
- GovukContentSchemaTestHelpers::ValidationErrorMessage
- Defined in:
- lib/govuk-content-schema-test-helpers/rspec_matchers.rb
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#schema_name ⇒ Object
readonly
Returns the value of attribute schema_name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(schema_name, type, payload) ⇒ ValidationErrorMessage
constructor
A new instance of ValidationErrorMessage.
- #message ⇒ Object
Constructor Details
#initialize(schema_name, type, payload) ⇒ ValidationErrorMessage
Returns a new instance of ValidationErrorMessage.
45 46 47 48 49 |
# File 'lib/govuk-content-schema-test-helpers/rspec_matchers.rb', line 45 def initialize(schema_name, type, payload) @schema_name = schema_name @type = type @payload = payload end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
43 44 45 |
# File 'lib/govuk-content-schema-test-helpers/rspec_matchers.rb', line 43 def payload @payload end |
#schema_name ⇒ Object (readonly)
Returns the value of attribute schema_name.
43 44 45 |
# File 'lib/govuk-content-schema-test-helpers/rspec_matchers.rb', line 43 def schema_name @schema_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
43 44 45 |
# File 'lib/govuk-content-schema-test-helpers/rspec_matchers.rb', line 43 def type @type end |
Instance Method Details
#message ⇒ Object
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/govuk-content-schema-test-helpers/rspec_matchers.rb', line 51 def <<-doc expected the payload to be valid against the '#{schema_name}' schema: #{formatted_payload} Validation errors: #{errors} doc end |