Permalink
Browse files

update Rails::Railtie::Configuration and ActionDispatch::Response#res…

…pond_to? to accept include_private argument
  • Loading branch information...
1 parent 5c6e11d commit ba5fab4c015366e355ab92371b27e77e896124a4 @jonkessler jonkessler committed Aug 16, 2013
@@ -181,7 +181,7 @@ def message
end
alias_method :status_message, :message
- def respond_to?(method)
+ def respond_to?(method, include_private = false)
if method.to_s == 'to_path'
stream.respond_to?(:to_path)
else
@@ -212,6 +212,11 @@ def test_response_body_encoding
ActionDispatch::Response.default_headers = nil
end
end
+
+ test "respond_to? accepts include_private" do
+ assert_not @response.respond_to?(:method_missing)
+ assert @response.respond_to?(:method_missing, true)
+ end
end
class ResponseIntegrationTest < ActionDispatch::IntegrationTest
@@ -80,7 +80,7 @@ def to_prepare(&blk)
to_prepare_blocks << blk if blk
end
- def respond_to?(name)
+ def respond_to?(name, include_private = false)
super || @@options.key?(name.to_sym)
end
@@ -679,5 +679,12 @@ def index
end
assert_equal Logger::INFO, Rails.logger.level
end
+
+ test "respond_to? accepts include_private" do
+ make_basic_app
+
+ assert_not Rails.configuration.respond_to?(:method_missing)
+ assert Rails.configuration.respond_to?(:method_missing, true)
+ end
end
end

1 comment on commit ba5fab4

Contributor

@jonkessler any plans to backport this to 4-0-stable?

Without this fix, rails 4.0.6.rc3 is incompatible with, e.g. rspec-mocks 3.0.2. See #15896

Please sign in to comment.