Removed further RSpec Deprecations

This commit is contained in:
Michael Dao 2015-03-09 15:51:50 -06:00
parent 1fa61dc331
commit a3b699cea9
3 changed files with 5 additions and 2 deletions

View File

@ -29,7 +29,7 @@ module Draper
describe ":context option" do
it "defaults to the identity function" do
Factory.should_receive(:new).with do |options|
Factory.should_receive(:new) do |options|
options[:context].call(:anything) == :anything
end
DecoratedAssociation.new(double, :association, {})

View File

@ -73,7 +73,7 @@ module Draper
decorated = OtherDecorator.new(Decorator.new(Model.new))
warning_message = nil
Object.any_instance.stub(:warn) {|message| warning_message = message }
Object.any_instance.stub(:warn) { |instance, message| warning_message = message }
expect{Decorator.new(decorated)}.to change{warning_message}
expect(warning_message).to start_with "Reapplying Draper::Decorator"

View File

@ -8,6 +8,9 @@ RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.expect_with(:rspec) {|c| c.syntax = :expect}
config.order = :random
config.mock_with :rspec do |mocks|
mocks.yield_receiver_to_any_instance_implementation_blocks = true
end
end
class Model; include Draper::Decoratable; end