Permalink
Browse files

Sidestep need for Kernel#silence_warnings

  • Loading branch information...
1 parent c79551f commit f9bd10054c5f60d82f0a2eb9448dd0b73729e787 @jeremy jeremy committed May 30, 2009
Showing with 4 additions and 4 deletions.
  1. +4 −4 actionpack/test/controller/routing_test.rb
@@ -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

0 comments on commit f9bd100

Please sign in to comment.