IMHO, when installing Rubymine (3.2.2) from default, it sets up the default test environment incorrectly. It is running "ruby -ltest" as a test environment instead of "rake". Example:
RubyMine output when running a specfic unit test:
/home/wanchic/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) -Itest /home/wanchic/Project/test/unit/patient_test.rb
When RubyMine does this, it does not load the test environment properly, hence resulting in the above implied error, "Not cleaning out test database before running tests." If I was to run this from command line, like so:
rake test:units TEST=test/unit/patient_test.rb
The proper test environment is loaded, the test databse is properly cleaned, and tests run successfully.
RubyMine's script will only work if the follwoing is run at commandline, each and every time before running a RubyMine test:
I've tried this with PostgreSQL and sqlite3, with same results.
My suggestion, is to change the new defaults for RubyMine so that when individual unit, controller, etc, tests are created, the following is generated instead:
/home/wanchic/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/wanchic/.rvm/gems/ruby-1.9.2-p180@rails31/bin/rake test TEST=/home/wanchic/Project/test/unit/patient_test.rb
In the meantime, how can I manly change this on my own?
To note, I am using:
ubuntu 10.04 LTS desktop
RubyMine 3.2.2 -107.446
ruby - 1.9.2-180