test/transition_test.rb in simplificator-fsm-0.2.4 vs test/transition_test.rb in simplificator-fsm-0.3.0
- old
+ new
@@ -3,12 +3,12 @@
class TransitionTest < Test::Unit::TestCase
context 'Initializer' do
should 'require name, from and to' do
- bli_state = FSM::State.new('bli')
- blo_state = FSM::State.new('blo')
+ bli_state = FSM::State.new('bli', self)
+ blo_state = FSM::State.new('blo', self)
assert_raise(ArgumentError) do
FSM::Transition.new(nil, nil, nil)
end
assert_raise(ArgumentError) do
FSM::Transition.new(:name, nil, nil)
@@ -31,14 +31,15 @@
FSM::Transition.new(:name, bli_state, blo_state)
end
should 'allow only valid options' do
- bli_state = FSM::State.new('bli')
- blo_state = FSM::State.new('blo')
+ bli_state = FSM::State.new('bli', self)
+ blo_state = FSM::State.new('blo', self)
assert_raise(ArgumentError) do
FSM::Transition.new(:name, bli_state, blo_state, :foo => 12)
end
FSM::Transition.new(:name, bli_state, blo_state, :event => :some)
+ FSM::Transition.new(:name, bli_state, blo_state, :guard => :some)
end
end
end