Created
March 23, 2010 05:24
-
-
Save dchelimsky/340860 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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