I&#39;m working on a series going over the source code for rspec, and I ran into something interesting with ExampleGroup and SharedExampleGroup. I was wondering if anyone could shed light on it.<br>[NOTE: I&#39;m working through the code for my own edification in learning Ruby. Ruby has some features that I think are incredibly cool, so I&#39;m using a concrete implementation (RSpec) as a learning tool to see them implemented. Along the way, I figured I would ask questions that were confusing&nbsp; to me. So, please bear with me and please please please do not take this as criticisms/attacks]
<br clear="all"><br>I expected to see SharedExampleGroup &lt; ExampleGroup, but, instead, I saw SharedExampleGroup &lt; Module. This is incredibly confusing to me. I realize that they don&#39;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&#39;t have a hierarchical relationship.
<br><br>If there is some hidden meaning, I&#39;d love to hear it. I&#39;ll post it as an update to the blog entry, too.<br><br>Oh, and here are the links to the first few parts of the series if anyone is interested: It looks like I&#39;ll be able to get about a post a week on it.
<br><br><p>part 1: <a title="http://www.coreyhaines.com/coreysramblings/2007/12/15/ARubyNewbieLooksThroughRSpecPartIWhatIsThis.aspx" href="http://www.coreyhaines.com/coreysramblings/2007/12/15/ARubyNewbieLooksThroughRSpecPartIWhatIsThis.aspx">
http://www.coreyhaines.com/coreysramblings/2007/12/15/ARubyNewbieLooksThroughRSpecPartIWhatIsThis.aspx</a></p>
<p>part 2: <a title="http://www.coreyhaines.com/coreysramblings/2007/12/15/ARubyNewbieLooksThroughRSpecPartIIDescribe.aspx" href="http://www.coreyhaines.com/coreysramblings/2007/12/15/ARubyNewbieLooksThroughRSpecPartIIDescribe.aspx">
http://www.coreyhaines.com/coreysramblings/2007/12/15/ARubyNewbieLooksThroughRSpecPartIIDescribe.aspx</a></p>
<p>part 3: <a title="http://www.coreyhaines.com/coreysramblings/2007/12/22/ARubyNewbieLooksThroughRSpecPartIIIDescribeRedux.aspx" href="http://www.coreyhaines.com/coreysramblings/2007/12/22/ARubyNewbieLooksThroughRSpecPartIIIDescribeRedux.aspx">
http://www.coreyhaines.com/coreysramblings/2007/12/22/ARubyNewbieLooksThroughRSpecPartIIIDescribeRedux.aspx</a></p>part 4: I&#39;m working on this, which is where I noticed the ExampleGroup/SharedExampleGroup thing.<br><br>
<br>-Corey<br><br>-- <br><a href="http://www.coreyhaines.com">http://www.coreyhaines.com</a><br>The Internet&#39;s Premiere source of information about Corey Haines