class ActionDispatch::Journey::Definition::TestParser

Public Instance Methods

assert_round_trip(str) click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 106
def assert_round_trip(str)
  assert_equal str, @parser.parse(str).to_s
end
setup() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 9
def setup
  @parser = Parser.new
end
test_arbitrary() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 94
def test_arbitrary
  assert_round_trip("/bar/*foo#")
end
test_dot_literal() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 50
def test_dot_literal
  assert_round_trip(".xml")
end
test_dot_symbol() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 46
def test_dot_symbol
  assert_round_trip(".:format")
end
test_group() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 34
def test_group
  assert_round_trip "(/:foo)"
end
test_group_followed_by_path() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 74
def test_group_followed_by_path
  assert_round_trip("/foo(/:action)/:bar")
end
test_groups() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 38
def test_groups
  assert_round_trip "(/:foo)(/:bar)"
end
test_groups_with_dot() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 102
def test_groups_with_dot
  assert_round_trip "/(:locale)(.:format)"
end
test_literal_dot_paren() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 98
def test_literal_dot_paren
  assert_round_trip "/sprockets.js(.:format)"
end
test_nested_groups() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 42
def test_nested_groups
  assert_round_trip "(/:foo(/:bar))"
end
test_or() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 85
def test_or
  assert_round_trip("a|b")
  assert_round_trip("a|b|c")
  assert_round_trip("(a|b)|c")
  assert_round_trip("a|(b|c)")
  assert_round_trip("*a|(b|c)")
  assert_round_trip("*a|:b|c")
end
test_segment() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 18
def test_segment
  assert_round_trip "/foo"
end
test_segment_dot() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 54
def test_segment_dot
  assert_round_trip("/foo.:bar")
end
test_segment_group() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 62
def test_segment_group
  assert_round_trip("/foo(/:action)")
end
test_segment_group_dot() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 58
def test_segment_group_dot
  assert_round_trip("/foo(.:bar)")
end
test_segment_groups() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 66
def test_segment_groups
  assert_round_trip("/foo(/:action)(/:bar)")
end
test_segment_nested_groups() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 70
def test_segment_nested_groups
  assert_round_trip("/foo(/:action(/:bar))")
end
test_segment_symbol() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 26
def test_segment_symbol
  assert_round_trip "/foo/:id"
end
test_segments() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 22
def test_segments
  assert_round_trip "/foo/bar"
end
test_slash() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 13
def test_slash
  assert_equal :SLASH, @parser.parse("/").type
  assert_round_trip "/"
end
test_star() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 78
def test_star
  assert_round_trip("*foo")
  assert_round_trip("/*foo")
  assert_round_trip("/bar/*foo")
  assert_round_trip("/bar/(*foo)")
end
test_symbol() click to toggle source
# File actionpack/test/journey/route/definition/parser_test.rb, line 30
def test_symbol
  assert_round_trip "/:foo"
end