Skip to content

Commit

Permalink
Update TSV class references
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxs0 committed Nov 25, 2024
1 parent afea032 commit d08ebc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/csv/test_tsv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ def test_default_separator
end

def test_override_separator
tsv = TSV.new(String.new, col_sep: ",")
tsv = CSV::TSV.new(String.new, col_sep: ",")
assert_equal(",", tsv.col_sep)
end

def test_read_tsv_data
data = "a\tb\tc\n1\t2\t3"
result = TSV.parse(data)
result = CSV::TSV.parse(data)
assert_equal([["a", "b", "c"], ["1", "2", "3"]], result.to_a)
end

def test_write_tsv_data
output = String.new
TSV.generate(output) do |tsv|
CSV::TSV.generate(output) do |tsv|
tsv << ["a", "b", "c"]
tsv << ["1", "2", "3"]
end
assert_equal("a\tb\tc\n1\t2\t3\n", output)
end

def test_inheritance
assert_kind_of(CSV, TSV.new(String.new))
assert_kind_of(CSV, CSV::TSV.new(String.new))
end
end

0 comments on commit d08ebc6

Please sign in to comment.