ruby-changes:50902
From: nobu <ko1@a...>
Date: Sat, 7 Apr 2018 12:48:50 +0900 (JST)
Subject: [ruby-changes:50902] nobu:r63109 (trunk): Use assert_include
nobu 2018-04-07 12:48:44 +0900 (Sat, 07 Apr 2018) New Revision: 63109 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63109 Log: Use assert_include For better failure message: - by assert_operator: Expected "X" to be include? "Y" - by assert_include: Expected "X" to include "Y" Modified files: trunk/test/webrick/test_httpserver.rb Index: test/webrick/test_httpserver.rb =================================================================== --- test/webrick/test_httpserver.rb (revision 63108) +++ test/webrick/test_httpserver.rb (revision 63109) @@ -436,7 +436,7 @@ class TestWEBrickHTTPServer < Test::Unit https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpserver.rb#L436 http.request(req) { |res| assert_equal('404', res.code) } exp = %Q(ERROR `/notexist\\n/foo' not found.\n) assert_equal 1, log_ary.size - assert_operator log_ary[0], :include?, exp + assert_include log_ary[0], exp ensure s&.shutdown th&.join @@ -445,7 +445,7 @@ class TestWEBrickHTTPServer < Test::Unit https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpserver.rb#L445 def test_gigantic_request_header log_tester = lambda {|log, access_log| assert_equal 1, log.size - assert_operator log[0], :include?, 'ERROR headers too large' + assert_include log[0], 'ERROR headers too large' } TestWEBrick.start_httpserver({}, log_tester){|server, addr, port, log| server.mount('/', WEBrick::HTTPServlet::FileHandler, __FILE__) @@ -462,7 +462,7 @@ class TestWEBrickHTTPServer < Test::Unit https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpserver.rb#L462 def test_eof_in_chunk log_tester = lambda do |log, access_log| assert_equal 1, log.size - assert_operator log[0], :include?, 'ERROR bad chunk data size' + assert_include log[0], 'ERROR bad chunk data size' end TestWEBrick.start_httpserver({}, log_tester){|server, addr, port, log| server.mount_proc('/', ->(req, res) { res.body = req.body }) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/