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

noreply at rubyforge.org noreply at rubyforge.org
Mon Nov 19 00:00:50 EST 2007


Feature Requests item #10941, was opened at 2007-05-20 15: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

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

Comment By: Chad Humphries (spicycode)
Date: 2007-11-19 00:00

Message:
Moved to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/92-10941-example-object-should-have-a-reference-to-its-description-object

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

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