[rspec-devel] [ rspec-Feature Requests-10753 ] Global before and after

noreply at rubyforge.org noreply at rubyforge.org
Thu May 10 17:10:46 EDT 2007


Feature Requests item #10753, was opened at 2007-05-10 21:10
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10753&group_id=797

Category: runner module
Group: None
Status: Open
Priority: 3
Submitted By: Assaf Arkin (assaf)
Assigned to: Nobody (None)
Summary: Global before and after

Initial Comment:
Side effects be damned. Unfortunately, we're running test cases in an environment that has a lot of them, so we need to sandbox the environment before every test, and reset it after every test.

Shared behavior works, but you need to include them in every single describe. Redundant. I eventually settled on this, hoping it will not break come 1.0:

Spec::Runner.configure { |config| config.include Sandbox }

class Spec::DSL::Behaviour
  before(:each) { sandbox }
  after(:each) { reset }
end

How about an easier way that will be a formal part of RSpec?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=10753&group_id=797


More information about the rspec-devel mailing list