Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

have invoke raise ArgumentErrors instead of TypeErrors

  • Loading branch information...
commit b10b80c28ec0010bda744cbaed1cb1a3b25431b3 1 parent 8f1c7bc
@rkh rkh authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  lib/sinatra/base.rb
  2. +2 −2 test/result_test.rb
View
2  lib/sinatra/base.rb
@@ -727,7 +727,7 @@ def invoke
res = catch(:halt) { yield }
res = [res] if Fixnum === res or String === res
if Array === res and Fixnum === res.first
- raise TypeError, "#{res.inspect} not supported" if res.length > 3
+ raise ArgumentError, "#{res.inspect} not supported" if res.length > 3
status(res.shift)
body(res.pop)
headers(*res)
View
4 test/result_test.rb
@@ -76,14 +76,14 @@ def res.each ; yield call ; end
assert_equal 'formula of', body
end
- it "raises a TypeError when result is a non two or three tuple Array" do
+ it "raises a ArgumentError when result is a non two or three tuple Array" do
mock_app {
get '/' do
[409, 'formula of', 'something else', 'even more']
end
}
- assert_raise(TypeError) { get '/' }
+ assert_raise(ArgumentError) { get '/' }
end
it "sets status when result is a Fixnum status code" do
Please sign in to comment.
Something went wrong with that request. Please try again.