Sha256: 5e749cad495b0d972a70b8453f847284efbe2385b702c47d52c2757715861077
Contents?: true
Size: 717 Bytes
Versions: 16
Compression:
Stored size: 717 Bytes
Contents
RSpec::Matchers.define :trigger_event do |event| match do |command| # PassiveRecord.drop_all Metacosm::Simulation.current.clear! Metacosm::Simulation.current.apply(command) Metacosm::Simulation.current.events.include?(event) end failure_message do |command| "expected that #{command.inspect} would trigger #{event.inspect}! Actual events were: #{Metacosm::Simulation.current.events}" end end RSpec::Matchers.define :trigger_events do |*events| match do |command| # PassiveRecord.drop_all Metacosm::Simulation.current.clear! Metacosm::Simulation.current.apply(command) events.all? do |event| Metacosm::Simulation.current.events.include?(event) end end end
Version data entries
16 entries across 16 versions & 1 rubygems