class DataMapperTest::MachineWithoutTransactionsTest

Public Instance Methods

setup() click to toggle source
# File test/unit/integrations/data_mapper_test.rb, line 728
def setup
  @resource = new_resource
  @machine = StateMachine::Machine.new(@resource, :use_transactions => false)
end
test_should_not_rollback_transaction_if_false() click to toggle source
# File test/unit/integrations/data_mapper_test.rb, line 733
def test_should_not_rollback_transaction_if_false
  @machine.within_transaction(@resource.new) do
    @resource.create
    false
  end
  
  assert_equal 1, @resource.all.size
end
test_should_not_rollback_transaction_if_true() click to toggle source
# File test/unit/integrations/data_mapper_test.rb, line 742
def test_should_not_rollback_transaction_if_true
  @machine.within_transaction(@resource.new) do
    @resource.create
    true
  end
  
  assert_equal 1, @resource.all.size
end