1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

implement respond_to_missing? to match method_missing

This commit is contained in:
David Feldman 2016-07-05 12:28:12 -05:00
parent 50819394c8
commit 5086432097
2 changed files with 11 additions and 0 deletions

View file

@ -206,6 +206,10 @@ module Rails
}
end
end
def respond_to_missing?(symbol, *)
true
end
end
end
end

View file

@ -33,6 +33,13 @@ module ApplicationTests
assert_nil x.i_do_not_exist.zomg
end
test 'custom configuration responds to all messages' do
x = Rails.configuration.x
assert_equal true, x.respond_to?(:i_do_not_exist)
assert_kind_of Method, x.method(:i_do_not_exist)
assert_kind_of ActiveSupport::OrderedOptions, x.i_do_not_exist
end
private
def new_app
File.expand_path("#{app_path}/../new_app")