diff options
author | Akira Matsuda <ronnie@dio.jp> | 2017-02-02 19:52:01 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2017-02-02 19:58:17 +0900 |
commit | f21c2492e519985ccf8ce95089a5aff74758e732 (patch) | |
tree | 860ba164ef1aa1d5019ddd8d915be7a1f26a6c4d /actionpack/test/journey | |
parent | 6c6668510ba63aeff942454647c98bda776fade1 (diff) | |
download | rails-f21c2492e519985ccf8ce95089a5aff74758e732.tar.gz rails-f21c2492e519985ccf8ce95089a5aff74758e732.tar.bz2 rails-f21c2492e519985ccf8ce95089a5aff74758e732.zip |
Properly escape test names
since the test names become Regexp filters, non-escaped test names cause RegexpError on isolated test via bin/test
Diffstat (limited to 'actionpack/test/journey')
-rw-r--r-- | actionpack/test/journey/path/pattern_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/test/journey/path/pattern_test.rb b/actionpack/test/journey/path/pattern_test.rb index d61a8c023a..2c74617944 100644 --- a/actionpack/test/journey/path/pattern_test.rb +++ b/actionpack/test/journey/path/pattern_test.rb @@ -20,7 +20,7 @@ module ActionDispatch "/:controller/*foo/bar" => %r{\A/(#{x})/(.+)/bar\Z}, "/:foo|*bar" => %r{\A/(?:([^/.?]+)|(.+))\Z}, }.each do |path, expected| - define_method(:"test_to_regexp_#{path}") do + define_method(:"test_to_regexp_#{Regexp.escape(path)}") do path = Pattern.build( path, { controller: /.+/ }, @@ -44,7 +44,7 @@ module ActionDispatch "/:controller/*foo/bar" => %r{\A/(#{x})/(.+)/bar}, "/:foo|*bar" => %r{\A/(?:([^/.?]+)|(.+))}, }.each do |path, expected| - define_method(:"test_to_non_anchored_regexp_#{path}") do + define_method(:"test_to_non_anchored_regexp_#{Regexp.escape(path)}") do path = Pattern.build( path, { controller: /.+/ }, @@ -67,7 +67,7 @@ module ActionDispatch "/:controller/*foo" => %w{ controller foo }, "/:controller/*foo/bar" => %w{ controller foo }, }.each do |path, expected| - define_method(:"test_names_#{path}") do + define_method(:"test_names_#{Regexp.escape(path)}") do path = Pattern.build( path, { controller: /.+/ }, |