Skip to content

Commit

Permalink
Silence warning: instance variable @segment not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Nov 9, 2009
1 parent ea345a5 commit 40f0ef7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions actionpack/test/controller/routing_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -754,7 +762,7 @@ def setup

ActionController::Routing.use_controllers! %w(content admin/user admin/news_feed)
end

def teardown
@rs.clear!
end
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 40f0ef7

Please sign in to comment.