spec/unit/events_spec.rb in finite_machine-0.4.0 vs spec/unit/events_spec.rb in finite_machine-0.5.0
- old
+ new
@@ -19,9 +19,20 @@
expect(fsm.current).to eql(:yellow)
fsm.stop
expect(fsm.current).to eql(:red)
end
+ it "allows to add event without events scope" do
+ fsm = FiniteMachine.define do
+ initial :green
+
+ event :slow, :green => :yellow
+ event :stop, :yellow => :red
+ end
+
+ expect(fsm.current).to eql(:green)
+ end
+
it "allows for (:from | :to) key pairs to describe transition" do
fsm = FiniteMachine.define do
initial :green
events {