Methods
T
Instance Public methods
test_following_states_multi()
# File actionpack/test/journey/gtg/builder_test.rb, line 7
def test_following_states_multi
  table  = tt ['a|a']
  assert_equal 1, table.move([0], 'a').length
end
test_following_states_multi_regexp()
# File actionpack/test/journey/gtg/builder_test.rb, line 12
def test_following_states_multi_regexp
  table  = tt [':a|b']
  assert_equal 1, table.move([0], 'fooo').length
  assert_equal 2, table.move([0], 'b').length
end
test_match_data_ambiguous()
# File actionpack/test/journey/gtg/builder_test.rb, line 33
def test_match_data_ambiguous
  table = tt %w{
    /articles(.:format)
    /articles/new(.:format)
    /articles/:id/edit(.:format)
    /articles/:id(.:format)
  }

  sim     = NFA::Simulator.new table

  match = sim.match '/articles/new'
  assert_equal 2, match.memos.length
end
test_match_same_paths()

Identical Routes may have different restrictions.

# File actionpack/test/journey/gtg/builder_test.rb, line 49
def test_match_same_paths
  table = tt %w{
    /articles/new(.:format)
    /articles/new(.:format)
  }

  sim     = NFA::Simulator.new table

  match = sim.match '/articles/new'
  assert_equal 2, match.memos.length
end
test_multi_path()
# File actionpack/test/journey/gtg/builder_test.rb, line 18
def test_multi_path
  table  = tt ['/:a/d', '/b/c']

  [
    [1, '/'],
    [2, 'b'],
    [2, '/'],
    [1, 'c'],
  ].inject([0]) { |state, (exp, sym)|
    new = table.move(state, sym)
    assert_equal exp, new.length
    new
  }
end