Forum: Ruby on Rails rake test without database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1bccbbeadf101f13b1d00a1538ea6b7a?d=identicon&s=25 Esad Hajdarevic (Guest)
on 2006-05-07 13:48
Hi!

Is it possible to run unit tests when no database is configured?

Rails recipes mentions putting following piece of code in a file within
lib/tasks/

[:test_units,:test_functional,:recent].each do |name|
  Rake::Task.lookup(name).prerequisites.clear
end

However this seem to be out-of-date, as task lookup in rake according to
RDoc is now done using Rake:Task[name]. But after I updated the code
above and set a breakpoint, the prerequisties for the :test_units seems
to be :test_units only, however I'm still getting

No such file or directory - db/schema.rb

when running rake test:units

Any advice?
1bccbbeadf101f13b1d00a1538ea6b7a?d=identicon&s=25 Esad Hajdarevic (Guest)
on 2006-05-07 14:07
The following seems to work:

["test:units","test:functionals","test:recent"].each do |name|
	Rake::Task[name].prerequisites.clear
end

Greetings,

Esad
This topic is locked and can not be replied to.