Permalink
Browse files

Silence warning: instance variable @segment not initialized

  • Loading branch information...
brynary committed Nov 9, 2009
1 parent ea345a5 commit 40f0ef7a37a9b2b66f58de8673b4d2df08a6d005
Showing with 13 additions and 5 deletions.
  1. +13 −5 actionpack/test/controller/routing_test.rb
@@ -107,7 +107,11 @@ def test_regexp_chunk_should_add_question_mark_for_optionals
end
end
-class DynamicSegmentTest < Test::Unit::TestCase
+class DynamicSegmentTest < ActiveSupport::TestCase
+ def setup
+ @segment = nil
+ end
+
def segment(options = {})
unless @segment
@segment = ROUTING::DynamicSegment.new(:a, options)
@@ -341,7 +345,11 @@ def test_regexp_should_only_match_possible_controllers
end
end
-class PathSegmentTest < Test::Unit::TestCase
+class PathSegmentTest < ActiveSupport::TestCase
+ def setup
+ @segment = nil
+ end
+
def segment(options = {})
unless @segment
@segment = ROUTING::PathSegment.new(:path, options)
@@ -754,7 +762,7 @@ def setup
ActionController::Routing.use_controllers! %w(content admin/user admin/news_feed)
end
-
+
def teardown
@rs.clear!
end
@@ -2564,10 +2572,10 @@ def test_load_with_configuration
routes.reload
end
-
+
def test_load_multiple_configurations
routes.add_configuration_file("engines.rb")
-
+
File.expects(:stat).at_least_once.returns(@stat)
routes.expects(:load).with('./config/routes.rb')

0 comments on commit 40f0ef7

Please sign in to comment.