From c15a6830637b280ebbf8d166e91a5558e58ce074 Mon Sep 17 00:00:00 2001 From: Joseph Anthony Pasquale Holsten Date: Sun, 2 Nov 2008 06:24:07 -0600 Subject: [PATCH] Fixed Strainer#respond_to? to accept two parameters --- lib/liquid/strainer.rb | 2 +- test/strainer_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/liquid/strainer.rb b/lib/liquid/strainer.rb index 7ef5e02..a857b6c 100644 --- a/lib/liquid/strainer.rb +++ b/lib/liquid/strainer.rb @@ -34,7 +34,7 @@ module Liquid strainer end - def respond_to?(method) + def respond_to?(method, include_private = false) method_name = method.to_s return false if method_name =~ INTERNAL_METHOD return false if @@required_methods.include?(method_name) diff --git a/test/strainer_test.rb b/test/strainer_test.rb index 45d8f42..540888c 100644 --- a/test/strainer_test.rb +++ b/test/strainer_test.rb @@ -13,4 +13,9 @@ class StrainerTest < Test::Unit::TestCase assert_equal true, strainer.respond_to?('size') # from the standard lib end + def test_should_respond_to_two_parameters + strainer = Strainer.create(nil) + assert_equal true, strainer.respond_to?('size', false) + end + end \ No newline at end of file