diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-14 16:01:23 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-14 16:01:23 -0600 |
commit | bcb686054a101c346eb13fee2053f08a585a7b55 (patch) | |
tree | 601b7cf2f504e27c45d928fbd884769a03a3acc6 | |
parent | 819a353c444569b7db7d0795dc3b40c745c5bc17 (diff) | |
download | rails-bcb686054a101c346eb13fee2053f08a585a7b55.tar.gz rails-bcb686054a101c346eb13fee2053f08a585a7b55.tar.bz2 rails-bcb686054a101c346eb13fee2053f08a585a7b55.zip |
Hush loading AR unless it fails
-rw-r--r-- | actionpack/test/active_record_unit.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/actionpack/test/active_record_unit.rb b/actionpack/test/active_record_unit.rb index 9e0c66055d..9a094cf66b 100644 --- a/actionpack/test/active_record_unit.rb +++ b/actionpack/test/active_record_unit.rb @@ -11,19 +11,15 @@ class ActiveRecordTestConnector end # Try to grab AR -if defined?(ActiveRecord) && defined?(Fixtures) - $stderr.puts 'Active Record is already loaded, running tests' -else - $stderr.print 'Attempting to load Active Record... ' +unless defined?(ActiveRecord) && defined?(Fixtures) begin PATH_TO_AR = "#{File.dirname(__FILE__)}/../../activerecord/lib" raise LoadError, "#{PATH_TO_AR} doesn't exist" unless File.directory?(PATH_TO_AR) $LOAD_PATH.unshift PATH_TO_AR require 'active_record' require 'active_record/fixtures' - $stderr.puts 'success' rescue LoadError => e - $stderr.print "failed. Skipping Active Record assertion tests: #{e}" + $stderr.print "Failed to load Active Record. Skipping Active Record assertion tests: #{e}" ActiveRecordTestConnector.able_to_connect = false end end |