class RubyEventStore::RSpec::HaveApplied

Attributes

events[R]
expected[R]
failure_message_formatter[R]
fetch_events[R]
phraser[R]

Public Class Methods

new(*expected, phraser:, failure_message_formatter:) click to toggle source
# 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 = failure_message_formatter
  @phraser   = phraser
  @fetch_events = FetchUnpublishedEvents.new
end

Public Instance Methods

description() click to toggle source
# 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) click to toggle source
# File lib/ruby_event_store/rspec/have_applied.rb, line 19
def exactly(count)
  expected.exactly(count)
  self
end
failure_message() click to toggle source
# File lib/ruby_event_store/rspec/have_applied.rb, line 39
def failure_message
  failure_message_formatter.failure_message(expected, events)
end
failure_message_when_negated() click to toggle source
# File lib/ruby_event_store/rspec/have_applied.rb, line 43
def failure_message_when_negated
  failure_message_formatter.failure_message_when_negated(expected, events)
end
matches?(aggregate_root) click to toggle source
# 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() click to toggle source
# File lib/ruby_event_store/rspec/have_applied.rb, line 29
def once
  expected.once
  self
end
strict() click to toggle source
# File lib/ruby_event_store/rspec/have_applied.rb, line 34
def strict
  expected.strict
  self
end
time()
Alias for: times
times() click to toggle source
# File lib/ruby_event_store/rspec/have_applied.rb, line 24
def times
  self
end
Also aliased as: time