class RSpec::SleepingKingStudios::Matchers::ActiveModel::HaveErrors::ErrorExpectation

Stores an expectation of receiving an error for a specified attribute, as well as zero or more message expectations.

@since 1.0.0

@see MessageExpectation

Attributes

messages[R]

The message expectations for the specified attribute. The returned array supports several additional methods: expected, missing, and received.

@return [Array<MessageExpectation>]

@see MessagesMethods#expected @see MessagesMethods#missing @see MessagesMethods#received

Public Class Methods

new(attribute, expected = true, received = false) click to toggle source

@param [String, Symbol] attribute The attribute for which an error is

expected to be or has been received.

@param [Boolean] expected Whether an error is expected for the specified

attribute.

@param [Boolean] received Whether an error has been received for the

specified attribute.
Calls superclass method
# File lib/rspec/sleeping_king_studios/matchers/active_model/have_errors/error_expectation.rb, line 41
def initialize attribute, expected = true, received = false
  super attribute.intern, expected, received

  @messages = []
  class << @messages
    include MessagesMethods
  end # eigenclass
end