Class: RSpec::SleepingKingStudios::Matchers::ActiveModel::HaveErrors::ErrorExpectation
- Parent Namespace
- RSpec::SleepingKingStudios::Matchers::ActiveModel::HaveErrors
- Inherited Classes
- Struct
>
Object
- Defined In
- lib/rspec/sleeping_king_studios/matchers/active_model/have_errors/error_expectation.rb
Table Of Contents
Overview
Stores an expectation of receiving an error for a specified attribute, as
well as zero or more message expectations.
See Also
Since
Back To Top
Defined Under Namespace
- Modules
- MessagesMethods
Back To Top
Constructor
#initialize attribute, expected = true, received = false => ErrorExpectation
Parameters
- attribute (String, Symbol) — The attribute for which an error is
expected to be or has been received.
- expected (Boolean) — Whether an error is expected for the specified
attribute.
- received (Boolean) — Whether an error has been received for the
specified attribute.
Returns
- (ErrorExpectation) — a new instance of ErrorExpectation
Since
Back To Top
Instance Attributes
#attribute => Object
Returns the value of attribute attribute
Returns
- (Object) — the current value of attribute
#expected => Object
Returns the value of attribute expected
Returns
- (Object) — the current value of expected
#messages => Array<MessageExpectation> (readonly)
The message expectations for the specified attribute. The returned array
supports several additional methods: #expected, #missing, and #received.
Returns
- (Array<MessageExpectation>)
See Also
Since
#received => Object
Returns the value of attribute received
Returns
- (Object) — the current value of received
Back To Top
Instance Methods
Back To Top
Back to
Documentation |
Versions |
2.8 |
Reference
|
RSpec
|
RSpec::SleepingKingStudios
|
RSpec::SleepingKingStudios::Matchers
|
RSpec::SleepingKingStudios::Matchers::ActiveModel
|
RSpec::SleepingKingStudios::Matchers::ActiveModel::HaveErrors