Permalink
Browse files

Merge pull request #9434 from zires/dev

Journey::Path::Pattern#new raise more meaningful exception message.
  • Loading branch information...
2 parents 62b783e + 35f38b7 commit 28bebb225f567b4c54b2f0ca0a2fc91c2a4d04be @rafaelfranca rafaelfranca committed Feb 26, 2013
View
@@ -3,6 +3,8 @@
## 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.
@@ -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
@@ -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',

0 comments on commit 28bebb2

Please sign in to comment.