[rspec-users] ExampleGroup and SharedExampleGroup relationship(?)

David Chelimsky dchelimsky at gmail.com
Thu Dec 27 12:42:14 EST 2007


On Dec 27, 2007 11:21 AM, Pat Maddox <pergesu at gmail.com> wrote:
> On Dec 27, 2007 8:30 AM, Corey Haines <coreyhaines at gmail.com> wrote:
> > I expected to see SharedExampleGroup < ExampleGroup, but, instead, I saw
> > SharedExampleGroup < Module. This is incredibly confusing to me. I realize
> > that they don't even need to have any relationship to each other since they
> > get their shared functionality through the module ExampleGroupMethods, but
> > it still seems a bit odd to me that they don't have a hierarchical
> > relationship.
>
> Whenever you write an example, RSpec defines a method.  Shared example
> groups are basically sugary modules.  They define examples - methods -
> that get included into your "real" example groups.
>
> I can't say for sure if there's any deeper meaning to it other than
> it's the simplest implementation.

That's about right.

Cheers,
David


More information about the rspec-users mailing list