diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index ab759865..2098cf5d 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -727,7 +727,7 @@ module Sinatra 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) diff --git a/test/result_test.rb b/test/result_test.rb index eb574c9b..22827f32 100644 --- a/test/result_test.rb +++ b/test/result_test.rb @@ -76,14 +76,14 @@ class ResultTest < Test::Unit::TestCase 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