daze wrote in post #970203: > Here's my issue: running ruby -I test test/unit/something_test.rb for > each of my unit tests works perfectly. > However, running rake test:units brings errors in all of them - some > object becomes nil for some reason.
And what object is that? > > Why might this be happening? > > Specifics: the object that is successfully not nil when I run the unit > tests one-by-one but becomes nil when I do rake test:units is defined > like this... > > klass = self.name.gsub(/Test$/, "").constantize > instance = klass.first Let's see your error messages. But why the heck are you defining an object like this anyway? What are you trying to achieve? > > ...and I'm sure that my test db is populated whenever I run my tests... You shouldn't have to be sure of that beforehand; rather, you should be using factories to create records for tests on the fly. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

