Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make ActionDispatch::Journey::Path::Pattern#new raise more meaningful…

… exception message.
  • Loading branch information...
commit 35f38b71dfeacbb4f92a2b1bf4d151c2061700d5 1 parent 202041e
@zires zires authored
View
2  actionpack/CHANGELOG.md
@@ -1,5 +1,7 @@
## Rails 4.0.0.beta1 (February 25, 2013) ##
+* Make ActionDispatch::Journey::Path::Pattern#new raise more meaningful exception message. *Thierry Zires*
+
* Fix `respond_to` not using formats that have no block if all is present. *Michael Grosser*
* New applications use an encrypted session store by default.
View
2  actionpack/lib/action_dispatch/journey/path/pattern.rb
@@ -20,7 +20,7 @@ def initialize(strexp)
@separators = strexp.separators.join
@anchored = strexp.anchor
else
- raise "wtf bro: #{strexp}"
+ raise ArgumentError, "Bad expression: #{strexp}"
end
@names = nil
View
4 actionpack/test/journey/path/pattern_test.rb
@@ -75,6 +75,10 @@ class TestPattern < ActiveSupport::TestCase
end
end
+ def test_to_raise_exception_with_bad_expression
+ assert_raise(ArgumentError, "Bad expression: []") { Pattern.new [] }
+ end
+
def test_to_regexp_with_extended_group
strexp = Router::Strexp.new(
'/page/:name',
Please sign in to comment.
Something went wrong with that request. Please try again.