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

Phlip phlip2005 at gmail.com
Sun Feb 1 15:42:57 EST 2009

Thomas R. Koll wrote:

> Are you sure it's inherit and not extend?

Per the blogs, inherit() got invented to install Test::Unit::TestCase, to get 
its extra goodies. That's a class, so you can't extend or import it!

Were those blog entries since redacted?

> Second, I guess the missing trace is cuz you should
> put a 'before' block into the describe.

Huh? The trace is just missing; test runners should propagate it.

> describe 'Post' do
>   before do
>     extend FixtureDependencies::SequelTestCase
>   end
> end

Here's the relevant bits that don't work. (I changed the goal library to the 
'assert2' patched into Test::Unit::Assertions.)

require File.join( File.dirname(__FILE__), '..', "spec_helper" )
require 'test/unit'
require 'assert2'

describe 'Post' do

   before do
     include Test::Unit::TestCase
      # inherit Test::Unit::TestCase # does not compile
      # include Test::Unit::Assertions # does not import assert{}

   it 'should have fixtures' do
     posts = posts(:Joan_Crawford_Has_Risen, :Jammin, :Sardonicus, :Lithium)
     posts[0].body.should == 'From the Grave'
     posts[0].tags.should include(tags(:progressive))

  # this line never compiles
     assert{ posts[0].tags.include? tags(:rocksteady) }


The rspec-rails plugin sure has me spoiled, huh? I formerly thought 
Test::Unit::Assertions would be automatically available, even without Rails 


More information about the rspec-users mailing list