> In a plugin we have to explicitly include ActiveRecord::TestFixtures to > enable fixtures in ActiveSupport::TestCase. So my thinking is it should > loudly fail instead of silently fail if it doesn't think ActiveRecord is > setup. Now if I understand you correctly, you are saying that that would > cause problems in Rails applications that aren't using ActiveRecord, because > the main Rails test framework automatically includes > ActiveRecord::TestFixtures into ActiveSupport::TestCase. It's probably not > be worth changing Rails to only include ActiveRecord::TestFixtures into > ActiveSupport::TestCase if ActiveRecord is in use, but it would be helpful > to document somewhere the dependency between > ActiveRecord::Base.configurations and fixtures.
You could also change the logic to be something along the lines of: defined?(ActiveRecord) && (!ActiveRecord::Base.configurations.blank? || already_connected_to_a_database) That would probably serve your case without breaking everyone else's. Alternatively perhaps logging (with debug level) a warning "fixtures not initialized because database not configured". However that could get spammy -- Cheers Koz -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" 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-core?hl=en.
