Skip to content

Instantly share code, notes, and snippets.

@pathsny
Created March 23, 2010 05:27
Show Gist options
  • Save pathsny/340862 to your computer and use it in GitHub Desktop.
Save pathsny/340862 to your computer and use it in GitHub Desktop.
describe "payment" do
prepend_before {@bypass_transactions = true}
it 'should hah' do
end
Spec::Runner.configure do |config|
config.before(:suite) do
DataMapper.auto_migrate!
end
config.after(:each) do
repository(:default) do
while repository.adapter.current_transaction
repository.adapter.current_transaction.rollback
repository.adapter.pop_transaction
end
end
end
config.before(:each) do
puts @bypass_transactions
repository(:default) do
transaction = DataMapper::Transaction.new(repository)
transaction.begin
repository.adapter.push_transaction(transaction)
end
Mocha::Configuration.prevent(:stubbing_non_existent_method)
end
config.mock_with :mocha
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment