Class: ObjectProtocol::UnorderedMessageSequenceExpectation
- Inherits:
-
Object
- Object
- ObjectProtocol::UnorderedMessageSequenceExpectation
- Defined in:
- lib/object_protocol/unordered_message_sequence_expectation.rb
Instance Method Summary collapse
- #expectations ⇒ Object
-
#initialize(protocol:) ⇒ UnorderedMessageSequenceExpectation
constructor
A new instance of UnorderedMessageSequenceExpectation.
- #to_rspec_matcher_failure_message_lines ⇒ Object
- #to_satisfiable ⇒ Object
Constructor Details
#initialize(protocol:) ⇒ UnorderedMessageSequenceExpectation
Returns a new instance of UnorderedMessageSequenceExpectation.
5 6 7 |
# File 'lib/object_protocol/unordered_message_sequence_expectation.rb', line 5 def initialize(protocol:) @protocol = protocol end |
Instance Method Details
#expectations ⇒ Object
9 10 11 |
# File 'lib/object_protocol/unordered_message_sequence_expectation.rb', line 9 def expectations @expectations ||= [] end |
#to_rspec_matcher_failure_message_lines ⇒ Object
13 14 15 16 17 18 |
# File 'lib/object_protocol/unordered_message_sequence_expectation.rb', line 13 def [ "in_any_order", *expectations.flat_map(&:to_rspec_matcher_failure_message_lines).map(&" ".method(:+)), ] end |
#to_satisfiable ⇒ Object
20 21 22 23 24 25 |
# File 'lib/object_protocol/unordered_message_sequence_expectation.rb', line 20 def to_satisfiable SatisfiableUnorderedMessageSequenceExpectation.new( protocol: protocol, sequence_expectation: self ) end |