[Rails] Testing Inconsistencies - ruby works rake fails

Greg Hansen grhansen at gmail.com
Tue Aug 8 21:06:50 GMT 2006


I'm getting some very weird results when testing my system.  If I run my 
unit tests using => ruby \test\unit\<filename.rb> each of the tests 
pass.  If I run => rake test_units I get several failures, and they all 
have to deal with the same issue.  For instance I'm getting => 
ActiveRecord::StatementInvalid: RuntimeError: ERROR     C42P01 
Mrelation "customers" does not exist    Fnamespace.c    L200 
RRangeVarGetRelid: DELETE FROM customers

Obviously I've checked and the customers table exists, and as I 
mentioned above, when I run => ruby test\unit\customer_test.rb all tests 
succeed. So I'm guessing there is something wrong with the way rake is 
loading up the tests and maybe not executing them correctly.

I am connecting to multiple databases in my application.  I've created a 
new database for my customers, licenses and products and am accessing 
some legacy databases for some historical data.  I'm doing joins b/n the 
databases fine in some other tests and those are succeeding when using 
rake, it's only the tests that run against my default test database 
which I setup specifically for the rails application.

For my fixtures, I am using the standard => fixtures :customers to 
manage the data loading and cleansing between runs.

Any help would be appreciated.

Thanks.
Greg

-- 
Posted via http://www.ruby-forum.com/.


More information about the Rails mailing list