class MachineWithActionDefinedInIncludedModuleTest

Public Instance Methods

save() click to toggle source
# File test/unit/machine_test.rb, line 699
def save
end
setup() click to toggle source
# File test/unit/machine_test.rb, line 697
def setup
  @mod = mod = Module.new do
    def save
    end
  end
  
  @klass = Class.new do
    include mod
  end
  
  @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 727
def test_should_define_action
  assert @klass.ancestors.any? {|ancestor| ![@klass, @mod].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 711
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 715
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 719
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 723
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 731
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 735
def test_should_mark_action_hook_as_defined
  assert @machine.action_hook?
end