diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-05 15:15:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-05 15:15:43 +0000 |
commit | 44785befeabd09d5d34f33b33783c0ec54f06a1f (patch) | |
tree | 56830470411bdaf525d1f4c489b120125efb9097 /test/csv | |
parent | 01e3a55648559ba3d54cdf72d5c55f71a41e69e9 (diff) |
* lib/optparse.rb (OptionParser#order, #permute, #parse): allow an
array as argument.
* test/ruby/test_*.rb: moved invariants to left side in
assert_equal, and use assert_nil, assert_raises and so on.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rw-r--r-- | test/csv/test_csv.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/csv/test_csv.rb b/test/csv/test_csv.rb index f1ba35a66f..e58bbc1e01 100644 --- a/test/csv/test_csv.rb +++ b/test/csv/test_csv.rb @@ -257,7 +257,7 @@ public r = CSV::Row[d(nil, true), d(2), d(3)] assert_equal([nil, '2', '3'], r.to_a, 'Null in data') - + r = CSV::Row[d(nil, true), d(nil, true), d(nil, true)] assert_equal([nil, nil, nil], r.to_a, 'Nulls') @@ -270,7 +270,7 @@ public #### CSV::Reader unit test - + def test_Reader_each file = File.open(@infile, "rb") begin @@ -441,7 +441,7 @@ public #### CSV::Writer unit test - + def test_Writer_s_new assert_raises(RuntimeError) do CSV::Writer.new(nil) @@ -1139,8 +1139,10 @@ public end def setBufSize(size) - CSV::StreamBuf.module_eval('remove_const("BufSize")') - CSV::StreamBuf.module_eval("BufSize = #{ size }") + CSV::StreamBuf.module_eval do + remove_const(:BufSize) + const_set(:BufSize, size) + end end class StrBuf < CSV::StreamBuf @@ -1282,7 +1284,7 @@ public # At first, check ruby's behaviour. assert_equal("", "abc"[3, 1]) assert_equal(nil, "abc"[4, 1]) - + setupInputStream(22, 1024) do |s| [0, 1, 9, 10, 19, 20, 21].each do |idx| assert_equal(expStr(idx, 1), s[idx, 1], idx.to_s) @@ -1346,7 +1348,7 @@ public assert_equal(nil, s.get(-1)) end end - + def test_StreamBuf_get_n setupInputStream(22, 1024) do |s| [0, 1, 9, 10, 19, 20, 21].each do |idx| |