class TransitionWithNamespaceTest
Public Instance Methods
setup()
click to toggle source
# File test/unit/transition_test.rb, line 179 def setup @klass = Class.new @machine = StateMachine::Machine.new(@klass, :namespace => 'alarm') @machine.state :off, :active @machine.event :activate @object = @klass.new @object.state = 'off' @transition = StateMachine::Transition.new(@object, @machine, :activate, :off, :active) end
test_should_have_a_from_name()
click to toggle source
# File test/unit/transition_test.rb, line 199 def test_should_have_a_from_name assert_equal :off, @transition.from_name end
test_should_have_a_human_from_name()
click to toggle source
# File test/unit/transition_test.rb, line 207 def test_should_have_a_human_from_name assert_equal 'off', @transition.human_from_name end
test_should_have_a_human_to_name()
click to toggle source
# File test/unit/transition_test.rb, line 219 def test_should_have_a_human_to_name assert_equal 'active', @transition.human_to_name end
test_should_have_a_qualified_event()
click to toggle source
# File test/unit/transition_test.rb, line 195 def test_should_have_a_qualified_event assert_equal :activate_alarm, @transition.qualified_event end
test_should_have_a_qualified_from_name()
click to toggle source
# File test/unit/transition_test.rb, line 203 def test_should_have_a_qualified_from_name assert_equal :alarm_off, @transition.qualified_from_name end
test_should_have_a_qualified_to_name()
click to toggle source
# File test/unit/transition_test.rb, line 215 def test_should_have_a_qualified_to_name assert_equal :alarm_active, @transition.qualified_to_name end
test_should_have_a_to_name()
click to toggle source
# File test/unit/transition_test.rb, line 211 def test_should_have_a_to_name assert_equal :active, @transition.to_name end
test_should_have_an_event()
click to toggle source
# File test/unit/transition_test.rb, line 191 def test_should_have_an_event assert_equal :activate, @transition.event end