Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created March 23, 2010 05:24
Show Gist options
  • Save dchelimsky/340860 to your computer and use it in GitHub Desktop.
Save dchelimsky/340860 to your computer and use it in GitHub Desktop.
def transactions(on_or_off=:on)
if on_or_off == :off
prepend_before { @transactions = :off }
end
end
Spec::Runner.configure do |c|
c.before(:each) do
@transactions ||= :on
if @transactions == :on
# setup transactions
end
end
c.after(:each) do
if @transactions == :on
# tear down transactions
end
end
end
describe "something" do
transactions :off
it "..." do
# ....
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment