Methods
- S
- T
Instance Public methods
simulator_for(paths)
Link
test_matchdata_has_memos()
Link
# File actionpack/test/journey/nfa/simulator_test.rb, line 47 def test_matchdata_has_memos paths = %w{ /foo /bar } parser = Journey::Parser.new asts = paths.map { |x| ast = parser.parse x ast.each { |n| n.memo = ast} ast } expected = asts.first builder = Builder.new Nodes::Or.new asts sim = Simulator.new builder.transition_table md = sim.match '/foo' assert_equal [expected], md.memos end
test_matchdata_memos_on_merge()
Link
# File actionpack/test/journey/nfa/simulator_test.rb, line 66 def test_matchdata_memos_on_merge parser = Journey::Parser.new routes = [ '/articles(.:format)', '/articles/new(.:format)', '/articles/:id/edit(.:format)', '/articles/:id(.:format)', ].map { |path| ast = parser.parse path ast.each { |n| n.memo = ast } ast } asts = routes.dup ast = Nodes::Or.new routes nfa = Journey::NFA::Builder.new ast sim = Simulator.new nfa.transition_table md = sim.match '/articles' assert_equal [asts.first], md.memos end
test_simulate_optional()
Link
test_simulate_or()
Link
test_simulate_regex()
Link
test_simulate_simple()
Link
test_simulate_simple_no_match()
Link
test_simulate_simple_no_match_too_long()
Link