class MachineAfterBeingCopiedTest

Public Instance Methods

setup() click to toggle source
# File test/unit/machine_test.rb, line 948
def setup
  @machine = StateMachine::Machine.new(Class.new, :state, :initial => :parked)
  @machine.event(:ignite) {}
  @machine.before_transition(lambda {})
  @machine.after_transition(lambda {})
  @machine.around_transition(lambda {})
  @machine.after_failure(lambda {})
  
  @copied_machine = @machine.clone
end
test_should_copy_each_event() click to toggle source
# File test/unit/machine_test.rb, line 979
def test_should_copy_each_event
  assert_not_same @copied_machine.events[:ignite], @machine.events[:ignite]
end
test_should_copy_each_state() click to toggle source
# File test/unit/machine_test.rb, line 963
def test_should_copy_each_state
  assert_not_same @copied_machine.states[:parked], @machine.states[:parked]
end
test_should_not_have_the_same_after_callbacks() click to toggle source
# File test/unit/machine_test.rb, line 999
def test_should_not_have_the_same_after_callbacks
  assert_not_same @copied_machine.callbacks[:after], @machine.callbacks[:after]
end
test_should_not_have_the_same_before_callbacks() click to toggle source
# File test/unit/machine_test.rb, line 995
def test_should_not_have_the_same_before_callbacks
  assert_not_same @copied_machine.callbacks[:before], @machine.callbacks[:before]
end
test_should_not_have_the_same_callbacks() click to toggle source
# File test/unit/machine_test.rb, line 991
def test_should_not_have_the_same_callbacks
  assert_not_same @copied_machine.callbacks, @machine.callbacks
end
test_should_not_have_the_same_collection_of_events() click to toggle source
# File test/unit/machine_test.rb, line 975
def test_should_not_have_the_same_collection_of_events
  assert_not_same @copied_machine.events, @machine.events
end
test_should_not_have_the_same_collection_of_states() click to toggle source
# File test/unit/machine_test.rb, line 959
def test_should_not_have_the_same_collection_of_states
  assert_not_same @copied_machine.states, @machine.states
end
test_should_not_have_the_same_failure_callbacks() click to toggle source
# File test/unit/machine_test.rb, line 1003
def test_should_not_have_the_same_failure_callbacks
  assert_not_same @copied_machine.callbacks[:failure], @machine.callbacks[:failure]
end
test_should_not_update_machine_for_original_event() click to toggle source
# File test/unit/machine_test.rb, line 987
def test_should_not_update_machine_for_original_event
  assert_equal @machine, @machine.events[:ignite].machine
end
test_should_not_update_machine_for_original_state() click to toggle source
# File test/unit/machine_test.rb, line 971
def test_should_not_update_machine_for_original_state
  assert_equal @machine, @machine.states[:parked].machine
end
test_should_update_machine_for_each_event() click to toggle source
# File test/unit/machine_test.rb, line 983
def test_should_update_machine_for_each_event
  assert_equal @copied_machine, @copied_machine.events[:ignite].machine
end
test_should_update_machine_for_each_state() click to toggle source
# File test/unit/machine_test.rb, line 967
def test_should_update_machine_for_each_state
  assert_equal @copied_machine, @copied_machine.states[:parked].machine
end