class MachineFinderWithExistingOnSameClassTest

Public Instance Methods

setup() click to toggle source
# File test/unit/machine_test.rb, line 3016
def setup
  @klass = Class.new
  @existing_machine = StateMachine::Machine.new(@klass)
  @machine = StateMachine::Machine.find_or_create(@klass)
end
test_should_accept_a_block() click to toggle source
# File test/unit/machine_test.rb, line 3022
def test_should_accept_a_block
  called = false
  StateMachine::Machine.find_or_create(@klass) do
    called = respond_to?(:event)
  end
  
  assert called
end
test_should_not_create_a_new_machine() click to toggle source
# File test/unit/machine_test.rb, line 3031
def test_should_not_create_a_new_machine
  assert_same @machine, @existing_machine
end