1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make ActionDispatch::Journey::Path::Pattern#new raise more meaningful exception message.

This commit is contained in:
zires 2013-02-26 13:09:13 +08:00
parent 202041e762
commit 35f38b71df
3 changed files with 7 additions and 1 deletions

View file

@ -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 file

@ -20,7 +20,7 @@ module ActionDispatch
@separators = strexp.separators.join
@anchored = strexp.anchor
else
raise "wtf bro: #{strexp}"
raise ArgumentError, "Bad expression: #{strexp}"
end
@names = nil

View file

@ -75,6 +75,10 @@ module ActionDispatch
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',