8000 Use assert_include · willnet/ruby@eaf5e34 · GitHub
[go: up one dir, main page]

Skip to content

Commit eaf5e34

Browse files
committed
Use assert_include
For better failure message: - by assert_operator: Expected "X" to be include? "Y" - by assert_include: Expected "X" to include "Y" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 5506e9b commit eaf5e34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/webrick/test_httpserver.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def test_cntrl_in_path
436436
http.request(req) { |res| assert_equal('404', res.code) }
437437
exp = %Q(ERROR `/notexist\\n/foo' not found.\n)
438438
assert_equal 1, log_ary.size
439-
assert_operator log_ary[0], :include?, exp
439+
assert_include log_ary[0], exp
440440
ensure
441441
s&.shutdown
442442
th&.join
@@ -445,7 +445,7 @@ def test_cntrl_in_path
445445
def test_gigantic_request_header
446446
log_tester = lambda {|log, access_log|
447447
assert_equal 1, log.size
448-
assert_operator log[0], :include?, 'ERROR headers too large'
448+
assert_include log[0], 'ERROR headers too large'
449449
}
450450
TestWEBrick.start_httpserver({}, log_tester){|server, addr, port, log|
451451
server.mount('/', WEBrick::HTTPServlet::FileHandler, __FILE__)
@@ -462,7 +462,7 @@ def test_gigantic_request_header
462462
def test_eof_in_chunk
463463
log_tester = lambda do |log, access_log|
464464
assert_equal 1, log.size
465-
assert_operator log[0], :include?, 'ERROR bad chunk data size'
465+
assert_include log[0], 'ERROR bad chunk data size'
466466
end
467467
TestWEBrick.start_httpserver({}, log_tester){|server, addr, port, log|
468468
server.mount_proc('/', ->(req, res) { res.body = req.body })

0 commit comments

Comments
 (0)
0