Rake test without database

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?

The following seems to work:

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

Greetings,

Esad

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs