class MachineWithActionAlreadyOverriddenTest

Public Instance Methods

save() click to toggle source
# File test/unit/machine_test.rb, line 826
def save
end
setup() click to toggle source
# File test/unit/machine_test.rb, line 824
def setup
  @superclass = Class.new do
    def save
    end
  end
  @klass = Class.new(@superclass)
  
  StateMachine::Machine.new(@klass, :action => :save)
  @machine = StateMachine::Machine.new(@klass, :status, :action => :save)
  @object = @klass.new
end
test_should_mark_action_hook_as_defined() click to toggle source
# File test/unit/machine_test.rb, line 840
def test_should_mark_action_hook_as_defined
  assert @machine.action_hook?
end
test_should_not_redefine_action() click to toggle source
# File test/unit/machine_test.rb, line 836
def test_should_not_redefine_action
  assert_equal 1, @klass.ancestors.select {|ancestor| ![@klass, @superclass].include?(ancestor) && ancestor.method_defined?(:save)}.length
end