Skip to content

Commit

Permalink
Checking for existence of ActiveRecord in proxy.rb before getting con…
Browse files Browse the repository at this point in the history
…stants from it.
  • Loading branch information
jonhyman committed Aug 18, 2012
1 parent fb55955 commit 780c42b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec/rails/extensions/active_record/proxy.rb
@@ -1,7 +1,7 @@
RSpec.configure do |rspec|
# Delay this in order to give users a chance to configure `expect_with`...
rspec.before(:suite) do
if defined?(RSpec::Matchers) && RSpec::Matchers.configuration.syntax.include?(:should)
if defined?(RSpec::Matchers) && RSpec::Matchers.configuration.syntax.include?(:should) && defined?(ActiveRecord)
# In Rails 3.0, it was AssociationProxy.
# In 3.1+, it's CollectionProxy.
const_name = [:CollectionProxy, :AssociationProxy].find do |const|
Expand Down

0 comments on commit 780c42b

Please sign in to comment.