[rspec-users] undefined method `inherit' for Merb::Test::ExampleGroup

Pat Maddox pergesu at gmail.com
Tue Feb 3 00:00:09 EST 2009

On Mon, Feb 2, 2009 at 8:36 PM, Phlip <phlip2005 at gmail.com> wrote:
> Pat Maddox wrote:
>> I'll blame Merb on the basis that there is no "inherit" in RSpec.  I'm
>> guessing it's some kind of merb extension.
> http://blog.davidchelimsky.net/2007/4/1/rspec-plays-nice-with-others
> I know I know - time flies!
> If it has been superseded, then how do you inject a batch of assertions
> defined in someone else's class into RSpec?
> For example, how does RSpec on Rails import its ActiveSupport::TestCase
> assertions?

rspec-rails defines Spec::Rails::Example::RailsExampleGroup that
inherits from ActiveSupport::TestCase.  All other example groups are
subclasses of REG.

What you want to do is something along the lines of:

class SequelExampleGroup < FixtureDependencies::SequelTestCase
  extend Spec::Example::ExampleGroupMethods
  include Spec::Example::ExampleMethods
  # also any other modules that contain merb-specific expectations
  Spec::Example::ExampleGroupFactory.register :sequel, self

describe 'Post', :type => :sequel do

(I don't know that that's exactly it, but it should get you going)

I think that forcing you to inherit from
FixtureDependencies::SequelTestCase is pretty sucky and I'm not sure
why they don't just have some modules that you could mix in in the
Spec::Runner.configure block.


More information about the rspec-users mailing list