[rspec-devel] [ rspec-Feature Requests-10941 ] Example object should have a reference to its Description object

noreply at rubyforge.org noreply at rubyforge.org
Sun May 20 15:06:12 EDT 2007


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

Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Brian Takita (btakita)
Assigned to: Nobody (None)
Summary: Example object should have a reference to its Description object

Initial Comment:
This would assist in plugging in shared before(:each) and after(:each) callbacks.

For example Nathan Wilmes had an issue with setting a mock by default and only in certain Behaviour, he wanted to turn off mocks. One possible implementation would be:

describe "Storage Service Setup" do
  before(:each) do
    unless behaviour.real_storage_service?
      StorageService.stub!(:something)
    end
  end
end

describe Foo do
  real_storage_service
  it_should_behave_like "Storahge Service Setup"
end

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

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


More information about the rspec-devel mailing list