diff options
-rw-r--r-- | lib/rack/response.rb | 2 | ||||
-rw-r--r-- | test/spec_response.rb | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/rack/response.rb b/lib/rack/response.rb index d75a0fac..d621587c 100644 --- a/lib/rack/response.rb +++ b/lib/rack/response.rb @@ -190,6 +190,8 @@ module Rack def forbidden?; status == 403; end def not_found?; status == 404; end def method_not_allowed?; status == 405; end + def not_acceptable?; status == 406; end + def request_timeout?; status == 408; end def precondition_failed?; status == 412; end def unprocessable?; status == 422; end diff --git a/test/spec_response.rb b/test/spec_response.rb index 5e6d5a5b..54f41753 100644 --- a/test/spec_response.rb +++ b/test/spec_response.rb @@ -503,6 +503,16 @@ describe Rack::Response do res.must_be :client_error? res.must_be :method_not_allowed? + res.status = 406 + res.wont_be :successful? + res.must_be :client_error? + res.must_be :not_acceptable? + + res.status = 408 + res.wont_be :successful? + res.must_be :client_error? + res.must_be :request_timeout? + res.status = 412 res.wont_be :successful? res.must_be :client_error? |