Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hush loading AR unless it fails

  • Loading branch information...
commit bcb686054a101c346eb13fee2053f08a585a7b55 1 parent 819a353
@josh josh authored
Showing with 2 additions and 6 deletions.
  1. +2 −6 actionpack/test/active_record_unit.rb
View
8 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
Please sign in to comment.
Something went wrong with that request. Please try again.