Are you sure it’s inherit and not extend?
Second, I guess the missing trace is cuz you should
put a ‘before’ block into the describe.
Took me some time to figure that out last month…
so try this and let us know the results:
describe ‘Post’ do
before do
extend FixtureDependencies::SequelTestCase
end
end
ciao, tom
Am 01.02.2009 um 16:50 schrieb Phlip:
inherit FixtureDependencies::SequelTestCase
And that leads to the syntax error in the subject line. (No stack
trace is available - ask the Merb spec runner why!)
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))
The rspec-rails plugin sure has me spoiled, huh? I formerly thought
Test::Unit::Assertions would be automatically available, even without
Rails
around…
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
end
describe ‘Post’, :type => :sequel do
…
end
(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.