Sha256: ae03711aae8e8c8171430b5f40a8c63b18789d535da4c2b5e17624116bad2bc9
Contents?: true
Size: 1.18 KB
Versions: 14
Compression:
Stored size: 1.18 KB
Contents
require_relative '../../test_helper' class TransitionWithNamespaceTest < StateMachinesTest def setup @klass = Class.new @machine = StateMachines::Machine.new(@klass, namespace: 'alarm') @machine.state :off, :active @machine.event :activate @object = @klass.new @object.state = 'off' @transition = StateMachines::Transition.new(@object, @machine, :activate, :off, :active) end def test_should_have_an_event assert_equal :activate, @transition.event end def test_should_have_a_qualified_event assert_equal :activate_alarm, @transition.qualified_event end def test_should_have_a_from_name assert_equal :off, @transition.from_name end def test_should_have_a_qualified_from_name assert_equal :alarm_off, @transition.qualified_from_name end def test_should_have_a_human_from_name assert_equal 'off', @transition.human_from_name end def test_should_have_a_to_name assert_equal :active, @transition.to_name end def test_should_have_a_qualified_to_name assert_equal :alarm_active, @transition.qualified_to_name end def test_should_have_a_human_to_name assert_equal 'active', @transition.human_to_name end end
Version data entries
14 entries across 14 versions & 2 rubygems