[rspec-devel] [ rspec-Feature Requests-14980 ] Nested Behaviour -- reopened

noreply at rubyforge.org noreply at rubyforge.org
Tue Oct 23 04:15:51 EDT 2007


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

Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Brian Takita (btakita)
Assigned to: Nobody (None)
Summary: Nested Behaviour -- reopened

Initial Comment:
I'd like to reopen discussion for Nested Behaviour. On my current project, we are in a situation where nested describe blocks would be an elegant way to organize our examples.

It should be easy to implement given the current state of the source.
All that needs to be done is have Example.describe create a subclass of the current class.

Currently, here is our setup:

module AssociationMethods
  describe Person, "#games" do
  end
end

module CustomMethods
  describe Person, "#current_game" do
  end
end

Having nested describe blocks would allow:
describe Person, "association methods" do
  describe Person, "#games" do
  end
end

describe Person, "custom methods" do
  describe Person, "#current_game" do
  end
end

Also nested behaviour would allow sharing of before and after blocks.

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

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


More information about the rspec-devel mailing list