test/with_different_ofs.rb: fixed typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3e7c68119c
commit
c41b036f4d
@ -3,10 +3,10 @@ Sat Dec 25 22:32:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||||||
* test/digest/test_digest_extend.rb (TestDigestExtend#setup):
|
* test/digest/test_digest_extend.rb (TestDigestExtend#setup):
|
||||||
should not depend on the result of previous tests
|
should not depend on the result of previous tests
|
||||||
|
|
||||||
* test/with_diffent_ofs.rb (DifferentOFS::WithDifferentOFS): give
|
* test/with_different_ofs.rb (DifferentOFS::WithDifferentOFS): give
|
||||||
name.
|
name.
|
||||||
|
|
||||||
* test/with_diffent_ofs.rb (DifferentOFS): test suite for test
|
* test/with_different_ofs.rb (DifferentOFS): test suite for test
|
||||||
suites affected by $,.
|
suites affected by $,.
|
||||||
|
|
||||||
* test/digest/test_digest_extend.rb (TestDigestExtend): should not
|
* test/digest/test_digest_extend.rb (TestDigestExtend): should not
|
||||||
@ -44,7 +44,7 @@ Sat Dec 25 18:30:34 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
|||||||
|
|
||||||
Sat Dec 25 17:33:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Dec 25 17:33:55 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* test/csv/base.rb (TestCSV.with_diffrent_ofs): give name to
|
* test/csv/base.rb (TestCSV.with_different_ofs): give name to
|
||||||
anonymous classes.
|
anonymous classes.
|
||||||
|
|
||||||
* lib/csv.rb (CSV#init_separators): use IO#gets with length
|
* lib/csv.rb (CSV#init_separators): use IO#gets with length
|
||||||
|
@ -2,7 +2,7 @@ require "test/unit"
|
|||||||
|
|
||||||
require "csv"
|
require "csv"
|
||||||
|
|
||||||
require_relative "../with_diffent_ofs.rb"
|
require_relative "../with_different_ofs.rb"
|
||||||
|
|
||||||
class TestCSV < Test::Unit::TestCase
|
class TestCSV < Test::Unit::TestCase
|
||||||
include DifferentOFS
|
include DifferentOFS
|
||||||
|
@ -216,6 +216,4 @@ class TestCSV::Parsing < TestCSV
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -92,6 +92,4 @@ class TestCSV::Writing < TestCSV
|
|||||||
CSV.generate_line( [1, "b", nil, %Q{already "quoted"}],
|
CSV.generate_line( [1, "b", nil, %Q{already "quoted"}],
|
||||||
force_quotes: true ) )
|
force_quotes: true ) )
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -11,6 +11,7 @@ require_relative "base"
|
|||||||
|
|
||||||
class TestCSV::DataConverters < TestCSV
|
class TestCSV::DataConverters < TestCSV
|
||||||
def setup
|
def setup
|
||||||
|
super
|
||||||
@data = "Numbers,:integer,1,:float,3.015"
|
@data = "Numbers,:integer,1,:float,3.015"
|
||||||
@parser = CSV.new(@data)
|
@parser = CSV.new(@data)
|
||||||
|
|
||||||
@ -257,6 +258,4 @@ class TestCSV::DataConverters < TestCSV
|
|||||||
assert_respond_to(row, :unconverted_fields)
|
assert_respond_to(row, :unconverted_fields)
|
||||||
assert_equal(Array.new, row.unconverted_fields)
|
assert_equal(Array.new, row.unconverted_fields)
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -11,6 +11,7 @@ require_relative "base"
|
|||||||
|
|
||||||
class TestCSV::Encodings < TestCSV
|
class TestCSV::Encodings < TestCSV
|
||||||
def setup
|
def setup
|
||||||
|
super
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
@temp_csv_file = Tempfile.new(%w"test_csv. .csv")
|
@temp_csv_file = Tempfile.new(%w"test_csv. .csv")
|
||||||
@temp_csv_path = @temp_csv_file.path
|
@temp_csv_path = @temp_csv_file.path
|
||||||
@ -19,6 +20,7 @@ class TestCSV::Encodings < TestCSV
|
|||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
@temp_csv_file.close!
|
@temp_csv_file.close!
|
||||||
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
@ -306,6 +308,4 @@ class TestCSV::Encodings < TestCSV
|
|||||||
yield encoding
|
yield encoding
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -31,6 +31,7 @@ class TestCSV::Features < TestCSV
|
|||||||
[%Q{"\r\n,",}, ["\r\n,", nil]] ]
|
[%Q{"\r\n,",}, ["\r\n,", nil]] ]
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
|
super
|
||||||
@sample_data = <<-END_DATA.gsub(/^ +/, "")
|
@sample_data = <<-END_DATA.gsub(/^ +/, "")
|
||||||
line,1,abc
|
line,1,abc
|
||||||
line,2,"def\nghi"
|
line,2,"def\nghi"
|
||||||
@ -263,6 +264,4 @@ class TestCSV::Features < TestCSV
|
|||||||
assert(CSV::VERSION.frozen?)
|
assert(CSV::VERSION.frozen?)
|
||||||
assert_match(/\A\d\.\d\.\d\Z/, CSV::VERSION)
|
assert_match(/\A\d\.\d\.\d\Z/, CSV::VERSION)
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -11,6 +11,7 @@ require_relative "base"
|
|||||||
|
|
||||||
class TestCSV::Headers < TestCSV
|
class TestCSV::Headers < TestCSV
|
||||||
def setup
|
def setup
|
||||||
|
super
|
||||||
@data = <<-END_CSV.gsub(/^\s+/, "")
|
@data = <<-END_CSV.gsub(/^\s+/, "")
|
||||||
first,second,third
|
first,second,third
|
||||||
A,B,C
|
A,B,C
|
||||||
@ -283,6 +284,4 @@ class TestCSV::Headers < TestCSV
|
|||||||
assert_instance_of(CSV::Row, row)
|
assert_instance_of(CSV::Row, row)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -11,6 +11,7 @@ require_relative "base"
|
|||||||
|
|
||||||
class TestCSV::Interface < TestCSV
|
class TestCSV::Interface < TestCSV
|
||||||
def setup
|
def setup
|
||||||
|
super
|
||||||
@path = File.join(File.dirname(__FILE__), "temp_test_data.csv")
|
@path = File.join(File.dirname(__FILE__), "temp_test_data.csv")
|
||||||
|
|
||||||
File.open(@path, "wb") do |file|
|
File.open(@path, "wb") do |file|
|
||||||
@ -23,6 +24,7 @@ class TestCSV::Interface < TestCSV
|
|||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
File.unlink(@path)
|
File.unlink(@path)
|
||||||
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
### Test Read Interface ###
|
### Test Read Interface ###
|
||||||
@ -304,6 +306,4 @@ class TestCSV::Interface < TestCSV
|
|||||||
assert_equal(STDOUT, CSV.instance.instance_eval { @io })
|
assert_equal(STDOUT, CSV.instance.instance_eval { @io })
|
||||||
assert_equal(STDOUT, CSV { |new_csv| new_csv.instance_eval { @io } })
|
assert_equal(STDOUT, CSV { |new_csv| new_csv.instance_eval { @io } })
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -11,6 +11,7 @@ require_relative "base"
|
|||||||
|
|
||||||
class TestCSV::Row < TestCSV
|
class TestCSV::Row < TestCSV
|
||||||
def setup
|
def setup
|
||||||
|
super
|
||||||
@row = CSV::Row.new(%w{A B C A A}, [1, 2, 3, 4])
|
@row = CSV::Row.new(%w{A B C A A}, [1, 2, 3, 4])
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -307,6 +308,4 @@ class TestCSV::Row < TestCSV
|
|||||||
"Header field pair not found." )
|
"Header field pair not found." )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -151,6 +151,4 @@ class TestCSV::Serialization < TestCSV
|
|||||||
obj = {1 => "simple", test: Hash}
|
obj = {1 => "simple", test: Hash}
|
||||||
assert_equal(obj, CSV.load(CSV.dump([obj])).first)
|
assert_equal(obj, CSV.load(CSV.dump([obj])).first)
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
@ -11,6 +11,7 @@ require_relative "base"
|
|||||||
|
|
||||||
class TestCSV::Table < TestCSV
|
class TestCSV::Table < TestCSV
|
||||||
def setup
|
def setup
|
||||||
|
super
|
||||||
@rows = [ CSV::Row.new(%w{A B C}, [1, 2, 3]),
|
@rows = [ CSV::Row.new(%w{A B C}, [1, 2, 3]),
|
||||||
CSV::Row.new(%w{A B C}, [4, 5, 6]),
|
CSV::Row.new(%w{A B C}, [4, 5, 6]),
|
||||||
CSV::Row.new(%w{A B C}, [7, 8, 9]) ]
|
CSV::Row.new(%w{A B C}, [7, 8, 9]) ]
|
||||||
@ -414,6 +415,4 @@ class TestCSV::Table < TestCSV
|
|||||||
@table.inspect.encoding ),
|
@table.inspect.encoding ),
|
||||||
"inspect() was not ASCII compatible." )
|
"inspect() was not ASCII compatible." )
|
||||||
end
|
end
|
||||||
|
|
||||||
with_diffrent_ofs
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user