1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/csv/test_row.rb: Added some missing tests in CSV.

* test/csv/test_table.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2014-09-05 09:34:38 +00:00
parent 192c39532b
commit 7e3b185a25
3 changed files with 23 additions and 0 deletions

View file

@ -54,6 +54,11 @@ class TestCSV::Table < TestCSV
assert_equal(@rows.first.headers, @table.headers)
end
def test_headers_empty
t = CSV::Table.new([])
assert_equal Array.new, t.headers
end
def test_index
##################
### Mixed Mode ###
@ -190,6 +195,14 @@ class TestCSV::Table < TestCSV
assert_raise(TypeError) { @table["Extra"] = nil }
end
def test_set_by_col_with_header_row
r = [ CSV::Row.new(%w{X Y Z}, [97, 98, 99], true) ]
t = CSV::Table.new(r)
t.by_col!
t['A'] = [42]
assert_equal(['A'], t['A'])
end
def test_each
######################
### Mixed/Row Mode ###