提交 c164ca1e 编写于 作者: J José Valim

Bring helpers_dir deprecation back.

上级 2d567e47
......@@ -56,10 +56,12 @@ module Helpers
module ClassMethods
def helpers_dir
ActiveSupport::Deprecation.warn "helpers_dir is deprecated, use helpers_path instead"
self.helpers_path
end
def helpers_dir=(value)
ActiveSupport::Deprecation.warn "helpers_dir= is deprecated, use helpers_path= instead"
self.helpers_path = Array(value)
end
......
......@@ -135,17 +135,16 @@ def test_helper_proxy
assert methods.include?('foobar')
end
# TODO Add this deprecation back before Rails 3.0 final release
# def test_deprecation
# assert_deprecated do
# ActionController::Base.helpers_dir = "some/foo/bar"
# end
# assert_deprecated do
# assert_equal ["some/foo/bar"], ActionController::Base.helpers_dir
# end
# ensure
# ActionController::Base.helpers_path = [File.dirname(__FILE__) + '/../fixtures/helpers']
# end
def test_deprecation
assert_deprecated do
ActionController::Base.helpers_dir = "some/foo/bar"
end
assert_deprecated do
assert_equal ["some/foo/bar"], ActionController::Base.helpers_dir
end
ensure
ActionController::Base.helpers_path = [File.dirname(__FILE__) + '/../fixtures/helpers']
end
private
def expected_helper_methods
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册