summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-09 00:51:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-09 00:51:12 +0000
commit7044cea301ddf80375bff2bab6021d28392bf94a ()
tree1cf9a00baa7c096051f88ebf304d82aa2df08832
parentf6695a95eabb16e89537b46efec2cba7b71aea2b (diff)
* test/webrick: Refine log tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--test/webrick/test_httpauth.rb37
-rw-r--r--test/webrick/utils.rb2
3 files changed, 28 insertions, 15 deletions
@@ -1,3 +1,7 @@
Sun Nov 9 08:58:05 2014 Tanaka Akira <[email protected]>
* defs/known_errors.def (EHWPOISON): New errno symbol.
@@ -61,11 +61,17 @@ class TestWEBrickHTTPAuth < Test::Unit::TestCase
http.request(g){|res| assert_not_equal("hoge", res.body, log.call)}
}
}
- pat = /ERROR Basic WEBrick's realm: webrick: password unmatch\./
- assert_match(pat, log); log.sub!(pat, '')
- pat = /ERROR WEBrick::HTTPStatus::Unauthorized/
- assert_match(pat, log); log.sub!(pat, '')
- assert_not_match(/ERROR/, log)
end
def test_basic_auth3
@@ -148,15 +154,18 @@ class TestWEBrickHTTPAuth < Test::Unit::TestCase
end
}
}
- pat = /ERROR Digest WEBrick's realm: no credentials in the request\./
- assert_match(pat, log); log.sub!(pat, '')
- pat = /ERROR WEBrick::HTTPStatus::Unauthorized/
- assert_match(pat, log); log.sub!(pat, '')
- pat = /ERROR Digest WEBrick's realm: webrick: digest unmatch\./
- assert_match(pat, log); log.sub!(pat, '')
- pat = /ERROR WEBrick::HTTPStatus::Unauthorized/
- assert_match(pat, log); log.sub!(pat, '')
- assert_not_match(/ERROR/, log)
end
private
@@ -41,7 +41,7 @@ module TestWEBrick
server = klass.new({
:BindAddress => "127.0.0.1", :Port => 0,
:ServerType => Thread,
- :Logger => WEBrick::Log.new(logger),
:AccessLog => [[logger, ""]]
}.update(config))
server_thread = server.start