spec/unit/events_spec.rb in finite_machine-0.2.0 vs spec/unit/events_spec.rb in finite_machine-0.3.0
- old
+ new
@@ -214,10 +214,11 @@
events {
event :stop, :green => :yellow
event :stop, :yellow => :red
event :stop, :red => :pink
+ event :cycle, [:yellow, :red, :pink] => :green
}
end
expect(fsm.current).to eql(:green)
@@ -227,9 +228,13 @@
expect(fsm.current).to eql(:yellow)
fsm.stop
expect(fsm.current).to eql(:red)
fsm.stop
expect(fsm.current).to eql(:pink)
+ fsm.cycle
+ expect(fsm.current).to eql(:green)
+ fsm.stop
+ expect(fsm.current).to eql(:yellow)
end
it "returns values for events" do
fsm = FiniteMachine.define do
initial :neutral