diff options
Diffstat (limited to 'test/webrick')
-rw-r--r-- | test/webrick/test_httpresponse.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/webrick/test_httpresponse.rb b/test/webrick/test_httpresponse.rb index b3f06cd469..d97a65b5db 100644 --- a/test/webrick/test_httpresponse.rb +++ b/test/webrick/test_httpresponse.rb @@ -146,5 +146,15 @@ module WEBrick } assert_equal 0, logger.messages.length end + + def test_set_error + status = 400 + message = 'missing attribute' + @res.status = status + error = WEBrick::HTTPStatus[status].new(message) + body = @res.set_error(error) + assert_match(/#{@res.reason_phrase}/, body) + assert_match(/#{message}/, body) + end end end |