Sha256: d26966463f152761dc04e63af654eef7d63b9f4aabba6afa308d20a8d885b129
Contents?: true
Size: 640 Bytes
Versions: 1
Compression:
Stored size: 640 Bytes
Contents
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) && defined?(ActiveRecord) # In Rails 3.0, it was AssociationProxy. # In 3.1+, it's CollectionProxy. const_name = [:CollectionProxy, :AssociationProxy].find do |const| ActiveRecord::Associations.const_defined?(const) end proxy_class = ActiveRecord::Associations.const_get(const_name) RSpec::Matchers.configuration.add_should_and_should_not_to proxy_class end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rspec-rails-2.12.0 | lib/rspec/rails/extensions/active_record/proxy.rb |