From c1d0768f349586cb62f06a5fbe84f408c5f3619a Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 17 Apr 2018 07:03:44 +0000 Subject: [PATCH] test/csv/test_features.rb: enable accidentally-disabled assertions CSV.new does not yield the instance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/csv/test_features.rb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/csv/test_features.rb b/test/csv/test_features.rb index 6b73093ad3..6dc6d34d46 100755 --- a/test/csv/test_features.rb +++ b/test/csv/test_features.rb @@ -304,19 +304,17 @@ class TestCSV::Features < TestCSV end def test_inspect_shows_headers_when_available - CSV.new("one,two,three\n1,2,3\n", headers: true) do |csv| - assert_include(csv.inspect, "headers:true", "Header hint not shown.") - csv.shift # load headers - assert_match(/headers:\[[^\]]+\]/, csv.inspect) - end + csv = CSV.new("one,two,three\n1,2,3\n", headers: true) + assert_include(csv.inspect, "headers:true", "Header hint not shown.") + csv.shift # load headers + assert_match(/headers:\[[^\]]+\]/, csv.inspect) end def test_inspect_encoding_is_ascii_compatible - CSV.new("one,two,three\n1,2,3\n".encode("UTF-16BE")) do |csv| - assert_send([Encoding, :compatible?, - Encoding.find("US-ASCII"), csv.inspect.encoding], - "inspect() was not ASCII compatible.") - end + csv = CSV.new("one,two,three\n1,2,3\n".encode("UTF-16BE")) + assert_send([Encoding, :compatible?, + Encoding.find("US-ASCII"), csv.inspect.encoding], + "inspect() was not ASCII compatible.") end def test_version