diff --git a/lib/stateflow/transition.rb b/lib/stateflow/transition.rb index bc29d99..ac1d99f 100644 --- a/lib/stateflow/transition.rb +++ b/lib/stateflow/transition.rb @@ -22,7 +22,8 @@ def find_to_state(base) to = execute_action(@decide, base) - @to.include?(to) ? to : (raise NoStateFound.new("Decision did not return a state that was set in the 'to' argument")) + raise NoStateFound.new("Decision did not return a state that was set in the 'to' argument") unless @to.include?(to) + to end private