diff options
author | James Tucker <jftucker@gmail.com> | 2014-07-14 10:59:47 -0700 |
---|---|---|
committer | James Tucker <jftucker@gmail.com> | 2014-07-14 11:02:01 -0700 |
commit | 167b6480235ff00ed5f355698bf00ec2f250f72e (patch) | |
tree | 8f1f0122769d6037f52d0718493e088e1a086ca9 /test/spec_utils.rb | |
parent | a11a76ec70528479e45554f2d93c735cc2fda4dc (diff) | |
download | rack-167b6480235ff00ed5f355698bf00ec2f250f72e.tar.gz |
ParameterTypeError for parse_nested_query
Inherits from TypeError, so existing code that checks types by is_a? and friends
should still work fine. This should enable users to be more confident that they
are only catching this error case, not other exceptional conditions.
Closes #524
Diffstat (limited to 'test/spec_utils.rb')
-rw-r--r-- | test/spec_utils.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/spec_utils.rb b/test/spec_utils.rb index a7894b45..6391f951 100644 --- a/test/spec_utils.rb +++ b/test/spec_utils.rb @@ -213,15 +213,15 @@ describe Rack::Utils do should.equal "x" => {"y" => [{"z" => "1", "w" => "a"}, {"z" => "2", "w" => "3"}]} lambda { Rack::Utils.parse_nested_query("x[y]=1&x[y]z=2") }. - should.raise(TypeError). + should.raise(Rack::Utils::ParameterTypeError). message.should.equal "expected Hash (got String) for param `y'" lambda { Rack::Utils.parse_nested_query("x[y]=1&x[]=1") }. - should.raise(TypeError). + should.raise(Rack::Utils::ParameterTypeError). message.should.match(/expected Array \(got [^)]*\) for param `x'/) lambda { Rack::Utils.parse_nested_query("x[y]=1&x[y][][w]=2") }. - should.raise(TypeError). + should.raise(Rack::Utils::ParameterTypeError). message.should.equal "expected Array (got String) for param `y'" end |