modocache / state_machine_rspec

Custom matchers for pluginaweek/state_machine.
https://rubygems.org/gems/state_machine_rspec
MIT License
13 stars 6 forks source link

triggers_event #11

Open aaronchi opened 10 years ago

aaronchi commented 10 years ago

Would be nice to have a triggers_event matcher for testing callbacks

modocache commented 10 years ago

Sounds interesting! Could you post a sample spec here that illustrates exactly what you're looking for?

aaronchi commented 10 years ago

Using the example from state_machine, something like:

it { should trigger_event :put_on_seatbelt, when: :parked, on: :ignite, before: :transition }
it { should trigger_event :tow, on: :crash, after: :transition }
it { should trigger_event :fix, on: :repair, after: :transition }
neumachen commented 9 years ago

Someone working on this? I can work on this if needed.