[rspec-devel] [ rspec-Feature Requests-10770 ] Allow before and after to be specified in config, finer grained includes

noreply at rubyforge.org noreply at rubyforge.org
Fri May 11 07:24:22 EDT 2007


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

Category: runner module
Group: None
Status: Open
Priority: 4
Submitted By: Aslak Hellesøy (aslak_hellesoy)
Assigned to: Nobody (None)
Summary: Allow before and after to be specified in config, finer grained includes

Initial Comment:
Suggestion:

Spec::Runner.configure do |config|
  config.before(:all) do
    # This will run for all Behaviours
  end

  config.before(:all, :behaviour_type => 'watir') do
    # This will only run for Watir behaviours
    @browser = Watir::Browser.new
  end

  # This will only include the module in Watir specs (to avoid collisions)
  config.include(Spec::Matchers::Watir, :behaviour_type => 'watir')
end

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

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-05-11 11:24

Message:
We should do this for fixtures as well. That way you can set up your fixtures for only your model behaviours and use mocks everywhere else.

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

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


More information about the rspec-devel mailing list