delegate respond_to? to decorated collection with second param

This commit is contained in:
Vasiliy Ermolovich 2012-04-10 23:12:27 +03:00
parent 3504393678
commit ac750a8eb9
2 changed files with 4 additions and 4 deletions

View File

@ -18,8 +18,8 @@ module Draper
@wrapped_collection.send(method, *args, &block)
end
def respond_to?(method)
super || @wrapped_collection.respond_to?(method)
def respond_to?(method, include_private = false)
super || @wrapped_collection.respond_to?(method, include_private)
end
def kind_of?(klass)

View File

@ -468,8 +468,8 @@ describe Draper::Base do
it "should delegate respond_to? to the wrapped collection" do
decorator = ProductDecorator.decorate(paged_array)
paged_array.should_receive(:respond_to?).with(:whatever)
decorator.respond_to?(:whatever)
paged_array.should_receive(:respond_to?).with(:whatever, true)
decorator.respond_to?(:whatever, true)
end
it "should return blank for a decorated empty collection" do