[rspec-users] Facets and/or Nested Describes

Steve vertebrate at gmail.com
Wed Oct 31 21:25:57 EDT 2007

On Mon, 29 Oct 2007 23:31:37 -0700, Brian Takita wrote:

> I have to confess that I did not know about facets before reading
> Ashley Moran's post:
> http://aviewfromafar.net/2007/10/21/quick-and-dirty-facets-in-rspec-trunk
> Not knowing about the facets solution, I made a couple of feature
> requests for nested describes:
> http://rubyforge.org/tracker/index.php?func=detail&aid=14980&group_id=797&atid=3152
> http://rubyforge.org/tracker/index.php?func=detail&aid=15088&group_id=797&atid=3152
> Currently in trunk, Example is the base class and other examples
> subclass. My proposal for the feature request is to have the
> Behaviour#describe method creates a subclass of itself when passed a
> block.
> The subclass then walks up its superclass chain and composes its
> description from its part and the parts of its superclasses.
> So facets are being used out there. How is that working out?
> There seems to be some overlap between the facets and nested describe
> block solution.
> Is facets a better solution than nested describes, (i.e. more
> semantically useful)?
> Implementation-wise, it seems that Example subclassing can be a
> solution to implementing facets. In addition, you would get before and
> after callbacks. Does that make sense for facets?
> Thanks,
> Brian

Like Ashley mentions this would be great for those long controllers.
Personally I prefer the semantics of "facet", but really would be fine
with nested describes. I have so much redundancy in my controllers. It
would be great to get rid of a lot of that. I think having before/after
callbacks would be mandatory.


More information about the rspec-users mailing list