Class: RubyEventStore::RSpec::HaveApplied
- Inherits:
-
Object
- Object
- RubyEventStore::RSpec::HaveApplied
- Defined in:
- lib/ruby_event_store/rspec/have_applied.rb
Instance Method Summary collapse
- #description ⇒ Object
- #exactly(count) ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(*expected, phraser:, failure_message_formatter:) ⇒ HaveApplied
constructor
A new instance of HaveApplied.
- #matches?(aggregate_root) ⇒ Boolean
- #once ⇒ Object
- #strict ⇒ Object
- #times ⇒ Object (also: #time)
Constructor Details
#initialize(*expected, phraser:, failure_message_formatter:) ⇒ HaveApplied
Returns a new instance of HaveApplied.
6 7 8 9 10 11 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 6 def initialize(*expected, phraser:, failure_message_formatter:) @expected = ExpectedCollection.new(expected) @failure_message_formatter = @phraser = phraser @fetch_events = FetchUnpublishedEvents.new end |
Instance Method Details
#description ⇒ Object
47 48 49 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 47 def description "have applied events that have to (#{phraser.(expected.events)})" end |
#exactly(count) ⇒ Object
19 20 21 22 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 19 def exactly(count) expected.exactly(count) self end |
#failure_message ⇒ Object
39 40 41 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 39 def .(expected, events) end |
#failure_message_when_negated ⇒ Object
43 44 45 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 43 def .(expected, events) end |
#matches?(aggregate_root) ⇒ Boolean
13 14 15 16 17 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 13 def matches?(aggregate_root) fetch_events.in(aggregate_root) @events = fetch_events.call MatchEvents.new.call(expected, events) end |
#once ⇒ Object
29 30 31 32 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 29 def once expected.once self end |
#strict ⇒ Object
34 35 36 37 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 34 def strict expected.strict self end |
#times ⇒ Object Also known as: time
24 25 26 |
# File 'lib/ruby_event_store/rspec/have_applied.rb', line 24 def times self end |