[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 08:50:02 EDT 2007


Feature Requests item #10770, was opened at 2007-05-11 04: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: Closed
Priority: 4
Submitted By: Aslak Hellesøy (aslak_hellesoy)
Assigned to: Aslak Hellesøy (aslak_hellesoy)
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: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-11 08:50

Message:
Fixed in r1944 - in Spec::DSL::Behaviour#include. The last arg can be a Hash.

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-11 08:28

Message:
Right - renames don't work in this tacker. Well - this one is now only about finer grained includes.

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-11 08:28

Message:
I'm renaming this issue - we'll deal with config.before/config.after in a separate issue.

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

Comment By: David Chelimsky (dchelimsky)
Date: 2007-05-11 07: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