It looks like your Rails application's test_helper doesn't know about some of the testing additions that Rails provides. Does it have the following lines at the top?
ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' Without these, Test::Unit would definitely fall over.... On 2/19/07, Peter Bex <[EMAIL PROTECTED]> wrote: > Hi there, > > I've been using Rails engines for a project. My unit tests work fine on the > project itself, but now I'm writing an engine, and this engine's unit tests > don't run correctly. I get this error: > > $ rake test:plugins:units > (in /home/peter/src/libersy) > /usr/pkg/bin/ruby18 -Ilib > "/usr/pkg/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb" > "vendor/plugins/authentication/test/unit/user_test.rb" > /home/peter/src/libersy/test/test_helper.rb:25: undefined method > `use_instantiated_fixtures=' for Test::Unit::TestCase:Class (NoMethodError) > from ./vendor/plugins/authentication/test/unit/../test_helper.rb:3 > from ./vendor/plugins/authentication/test/unit/user_test.rb:1 > from > /usr/pkg/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5 > from > /usr/pkg/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5 > rake aborted! > Command failed with status (1): [/usr/pkg/bin/ruby18 -Ilib > "/usr/pkg/lib/ru...] > > (See full trace by running task with --trace) > > I've tried googling for this error, but couldn't find anything useful. > My plugin's test_helper looks like this: > > # Load the normal Rails helper. This ensures the environment is loaded > > require File.expand_path(File.dirname(__FILE__) + > '/../../../../test/test_helper') > # Ensure that we are using the temporary fixture path > Engines::Testing.set_fixture_path > > I also get the error when I try to run the test directly from the console, > like so: > ruby vendor/plugins/authentication/test/unit/user_test.rb > > Any idea what could cause this? > > Regards, > Peter Bex > Solide ICT - http://www.solide-ict.nl > _______________________________________________ > engine-developers mailing list > [email protected] > http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org > -- * J * ~ _______________________________________________ engine-developers mailing list [email protected] http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org
