Sha256: 68dac28d2d3579ef8d7128745a7ef21874ddcbd3ad43905f97275a348e16f520
Contents?: true
Size: 602 Bytes
Versions: 15
Compression:
Stored size: 602 Bytes
Contents
RSpec::Matchers.define :allow_event do |event| match do |obj| @state_machine_name ||= :default obj.aasm(@state_machine_name).may_fire_event?(event) end chain :on do |state_machine_name| @state_machine_name = state_machine_name end description do "allow event #{expected} (on :#{@state_machine_name})" end failure_message do |obj| "expected that the event :#{expected} would be allowed (on :#{@state_machine_name})" end failure_message_when_negated do |obj| "expected that the event :#{expected} would not be allowed (on :#{@state_machine_name})" end end
Version data entries
15 entries across 15 versions & 1 rubygems