alexpeachey / end_state

A State Machine implementation
MIT License
9 stars 5 forks source link

Calling a transition "fail" causes errors with invalid transitions #35

Open VOjha opened 8 years ago

VOjha commented 8 years ago

If you have a transition named :fail and then try to call an invalid transition (the ! version), instead of getting an invalid transition error, you get an undefined method error for [] on EndState::InvalidTransition.

class TestMachine < EndState::StateMachine
  transition open: :failed, as: :fail
end

TestMachine.new(object).some_random_transition!
# undefined method '[]' for EndState::InvalidTransition:Class