Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
delegate respond_to? to decorated collection with second param
  • Loading branch information
nashby committed Apr 10, 2012
1 parent 3504393 commit ac750a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/draper/decorated_enumerable_proxy.rb
Expand Up @@ -18,8 +18,8 @@ def method_missing (method, *args, &block)
@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)
Expand Down
4 changes: 2 additions & 2 deletions spec/draper/base_spec.rb
Expand Up @@ -468,8 +468,8 @@ module Paginator; def page_number; "magic_value"; end; end

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
Expand Down

0 comments on commit ac750a8

Please sign in to comment.