mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/csv/test_data_converters.rb: use descriptive assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0b8233ab07
commit
2d89896461
7 changed files with 65 additions and 75 deletions
|
@ -85,8 +85,8 @@ class TestCSV::Headers < TestCSV
|
|||
assert_not_nil(row)
|
||||
assert_instance_of(CSV::Row, row)
|
||||
assert_equal([["my", :my], ["new", :new], ["headers", :headers]], row.to_a)
|
||||
assert(row.header_row?)
|
||||
assert(!row.field_row?)
|
||||
assert_predicate(row, :header_row?)
|
||||
assert_not_predicate(row, :field_row?)
|
||||
end
|
||||
|
||||
def test_csv_header_string
|
||||
|
@ -127,8 +127,8 @@ class TestCSV::Headers < TestCSV
|
|||
assert_not_nil(row)
|
||||
assert_instance_of(CSV::Row, row)
|
||||
assert_equal([[:my, "my"], [:new, "new"], [:headers, "headers"]], row.to_a)
|
||||
assert(row.header_row?)
|
||||
assert(!row.field_row?)
|
||||
assert_predicate(row, :header_row?)
|
||||
assert_not_predicate(row, :field_row?)
|
||||
end
|
||||
|
||||
def test_csv_header_string_inherits_separators
|
||||
|
@ -159,24 +159,24 @@ class TestCSV::Headers < TestCSV
|
|||
assert_instance_of(CSV::Row, row)
|
||||
assert_equal( [%w{first first}, %w{second second}, %w{third third}],
|
||||
row.to_a )
|
||||
assert(row.header_row?)
|
||||
assert(!row.field_row?)
|
||||
assert_predicate(row, :header_row?)
|
||||
assert_not_predicate(row, :field_row?)
|
||||
|
||||
# first data row - skipping headers
|
||||
row = csv[1]
|
||||
assert_not_nil(row)
|
||||
assert_instance_of(CSV::Row, row)
|
||||
assert_equal([%w{first A}, %w{second B}, %w{third C}], row.to_a)
|
||||
assert(!row.header_row?)
|
||||
assert(row.field_row?)
|
||||
assert_not_predicate(row, :header_row?)
|
||||
assert_predicate(row, :field_row?)
|
||||
|
||||
# second data row
|
||||
row = csv[2]
|
||||
assert_not_nil(row)
|
||||
assert_instance_of(CSV::Row, row)
|
||||
assert_equal([%w{first 1}, %w{second 2}, %w{third 3}], row.to_a)
|
||||
assert(!row.header_row?)
|
||||
assert(row.field_row?)
|
||||
assert_not_predicate(row, :header_row?)
|
||||
assert_predicate(row, :field_row?)
|
||||
|
||||
# empty
|
||||
assert_nil(csv[3])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue