class MachineWithActionDefinedInSuperclassTest
Public Instance Methods
save()
click to toggle source
# File test/unit/machine_test.rb, line 743 def save end
setup()
click to toggle source
# File test/unit/machine_test.rb, line 741 def setup @superclass = Class.new do def save end end @klass = Class.new(@superclass) @machine = StateMachine::Machine.new(@klass, :action => :save) @object = @klass.new end
test_should_define_action()
click to toggle source
# File test/unit/machine_test.rb, line 768 def test_should_define_action assert @klass.ancestors.any? {|ancestor| ![@klass, @superclass].include?(ancestor) && ancestor.method_defined?(:save)} end
test_should_define_an_event_attribute_reader()
click to toggle source
# File test/unit/machine_test.rb, line 752 def test_should_define_an_event_attribute_reader assert @object.respond_to?(:state_event) end
test_should_define_an_event_attribute_writer()
click to toggle source
# File test/unit/machine_test.rb, line 756 def test_should_define_an_event_attribute_writer assert @object.respond_to?(:state_event=) end
test_should_define_an_event_transition_attribute_reader()
click to toggle source
# File test/unit/machine_test.rb, line 760 def test_should_define_an_event_transition_attribute_reader assert @object.respond_to?(:state_event_transition) end
test_should_define_an_event_transition_attribute_writer()
click to toggle source
# File test/unit/machine_test.rb, line 764 def test_should_define_an_event_transition_attribute_writer assert @object.respond_to?(:state_event_transition=) end
test_should_keep_action_public()
click to toggle source
# File test/unit/machine_test.rb, line 772 def test_should_keep_action_public assert @klass.public_method_defined?(:save) end
test_should_mark_action_hook_as_defined()
click to toggle source
# File test/unit/machine_test.rb, line 776 def test_should_mark_action_hook_as_defined assert @machine.action_hook? end