зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
7735e2da11
Коммит
c1d0768f34
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче