Skip to content

Commit 886e867

Browse files
author
Sam Phippen
authored
Merge pull request rspec#1856 from lazyatom/only-configure-rspec-mocks-if-fully-loaded
Only configure RSpec::Mocks if it is fully loaded
2 parents f33dde7 + f182eac commit 886e867

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rspec/rails/active_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class ActiveRecordConfiguration
77
def self.initialize_activerecord_configuration(config)
88
config.before :suite do
99
# This allows dynamic columns etc to be used on ActiveRecord models when creating instance_doubles
10-
if defined?(ActiveRecord) && defined?(ActiveRecord::Base) && defined?(::RSpec::Mocks)
10+
if defined?(ActiveRecord) && defined?(ActiveRecord::Base) && defined?(::RSpec::Mocks) && (::RSpec::Mocks.respond_to?(:configuration))
1111
::RSpec::Mocks.configuration.when_declaring_verifying_double do |possible_model|
1212
target = possible_model.target
1313

0 commit comments

Comments
 (0)