test_features.rb: fix up r46123
* test/csv/test_features.rb: no longer `nil` is valid data source for `CSV.new`. [GH-580] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1902f5fa25
commit
ae3022e434
@ -123,7 +123,9 @@ class TestCSV::Features < TestCSV
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_unknown_options
|
def test_unknown_options
|
||||||
assert_raise(ArgumentError) { CSV.new(String.new, unknown: :error) }
|
assert_raise_with_message(ArgumentError, /unknown/) {
|
||||||
|
CSV.new(@sample_data, unknown: :error)
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_skip_blanks
|
def test_skip_blanks
|
||||||
@ -283,13 +285,13 @@ class TestCSV::Features < TestCSV
|
|||||||
|
|
||||||
def test_accepts_comment_skip_lines_option
|
def test_accepts_comment_skip_lines_option
|
||||||
assert_nothing_raised(ArgumentError) do
|
assert_nothing_raised(ArgumentError) do
|
||||||
CSV.new nil, :skip_lines => /\A\s*#/
|
CSV.new(@sample_data, :skip_lines => /\A\s*#/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_accepts_comment_defaults_to_nil
|
def test_accepts_comment_defaults_to_nil
|
||||||
c = CSV.new nil
|
c = CSV.new(@sample_data)
|
||||||
assert_equal c.skip_lines, nil
|
assert_nil(c.skip_lines)
|
||||||
end
|
end
|
||||||
|
|
||||||
class RegexStub
|
class RegexStub
|
||||||
@ -297,8 +299,8 @@ class TestCSV::Features < TestCSV
|
|||||||
|
|
||||||
def test_requires_skip_lines_to_call_match
|
def test_requires_skip_lines_to_call_match
|
||||||
regex_stub = RegexStub.new
|
regex_stub = RegexStub.new
|
||||||
assert_raise(ArgumentError) do
|
assert_raise_with_message(ArgumentError, /skip_lines/) do
|
||||||
CSV.new nil, :skip_lines => regex_stub
|
CSV.new(@sample_data, :skip_lines => regex_stub)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user