class EventByDefaultTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/event_test.rb, line 4 def setup @klass = Class.new @machine = StateMachine::Machine.new(@klass) @machine.events << @event = StateMachine::Event.new(@machine, :ignite) @object = @klass.new end
test_should_define_a_bang_action()
click to toggle source
# File test/unit/event_test.rb, line 56 def test_should_define_a_bang_action assert @object.respond_to?(:ignite!) end
test_should_define_a_predicate()
click to toggle source
# File test/unit/event_test.rb, line 44 def test_should_define_a_predicate assert @object.respond_to?(:can_ignite?) end
test_should_define_a_transition_accessor()
click to toggle source
# File test/unit/event_test.rb, line 48 def test_should_define_a_transition_accessor assert @object.respond_to?(:ignite_transition) end
test_should_define_an_action()
click to toggle source
# File test/unit/event_test.rb, line 52 def test_should_define_an_action assert @object.respond_to?(:ignite) end
test_should_have_a_human_name()
click to toggle source
# File test/unit/event_test.rb, line 24 def test_should_have_a_human_name assert_equal 'ignite', @event.human_name end
test_should_have_a_machine()
click to toggle source
# File test/unit/event_test.rb, line 12 def test_should_have_a_machine assert_equal @machine, @event.machine end
test_should_have_a_name()
click to toggle source
# File test/unit/event_test.rb, line 16 def test_should_have_a_name assert_equal :ignite, @event.name end
test_should_have_a_qualified_name()
click to toggle source
# File test/unit/event_test.rb, line 20 def test_should_have_a_qualified_name assert_equal :ignite, @event.qualified_name end
test_should_have_no_known_states()
click to toggle source
# File test/unit/event_test.rb, line 32 def test_should_have_no_known_states assert @event.known_states.empty? end
test_should_not_be_able_to_fire()
click to toggle source
# File test/unit/event_test.rb, line 36 def test_should_not_be_able_to_fire assert !@event.can_fire?(@object) end
test_should_not_have_a_transition()
click to toggle source
# File test/unit/event_test.rb, line 40 def test_should_not_have_a_transition assert_nil @event.transition_for(@object) end
test_should_not_have_any_branches()
click to toggle source
# File test/unit/event_test.rb, line 28 def test_should_not_have_any_branches assert @event.branches.empty? end