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{}
end
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) }
end
end
The rspec-rails plugin sure has me spoiled, huh? I formerly thought
Test::Unit::Assertions would be automatically available, even without Rails
around...
--
Phlip
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users