Module: RSpec::SleepingKingStudios::Matchers::ActiveModel::HaveErrors::ErrorExpectation::MessagesMethods Private

Defined in:
lib/rspec/sleeping_king_studios/matchers/active_model/have_errors/error_expectation.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Extra instance methods for the :messages array.

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#expectedArray<MessageExpectation>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns Messages that are expected.

Returns:

Since:

  • 1.0.0



19
20
21
# File 'lib/rspec/sleeping_king_studios/matchers/active_model/have_errors/error_expectation.rb', line 19

def expected
  select { |message| message.expected }
end

#missingArray<MessageExpectation>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns Messages that are expected but have not been received.

Returns:

Since:

  • 1.0.0



25
26
27
# File 'lib/rspec/sleeping_king_studios/matchers/active_model/have_errors/error_expectation.rb', line 25

def missing
  select { |message| message.expected && !message.received }
end

#receivedArray<MessageExpectation>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns Messages that have been received.

Returns:

Since:

  • 1.0.0



30
31
32
# File 'lib/rspec/sleeping_king_studios/matchers/active_model/have_errors/error_expectation.rb', line 30

def received
  select { |message| message.received }
end