提交 f9bd1005 编写于 作者: J Jeremy Kemper

Sidestep need for Kernel#silence_warnings

上级 c79551f0
......@@ -649,9 +649,8 @@ def test_possible_controllers
ActionController::Routing.use_controllers! nil
silence_warnings do
Object.send(:const_set, :RAILS_ROOT, File.dirname(__FILE__) + '/controller_fixtures')
end
Object.send(:remove_const, :RAILS_ROOT) if defined?(::RAILS_ROOT)
Object.const_set(:RAILS_ROOT, File.dirname(__FILE__) + '/controller_fixtures')
ActionController::Routing.controller_paths = [
RAILS_ROOT, RAILS_ROOT + '/app/controllers', RAILS_ROOT + '/vendor/plugins/bad_plugin/lib'
......@@ -2487,7 +2486,8 @@ def test_route_requirement_recognize_with_xi_modifiers
class RouteLoadingTest < Test::Unit::TestCase
def setup
routes.instance_variable_set '@routes_last_modified', nil
silence_warnings { Object.const_set :RAILS_ROOT, '.' }
Object.remove_const(:RAILS_ROOT) if defined?(::RAILS_ROOT)
Object.const_set :RAILS_ROOT, '.'
routes.add_configuration_file(File.join(RAILS_ROOT, 'config', 'routes.rb'))
@stat = stub_everything
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册