[前][次][番号順一覧][スレッド一覧]

ruby-changes:34044

From: nobu <ko1@a...>
Date: Mon, 26 May 2014 11:58:28 +0900 (JST)
Subject: [ruby-changes:34044] nobu:r46125 (trunk): test_features.rb: fix up r46123

nobu	2014-05-26 11:58:15 +0900 (Mon, 26 May 2014)

  New Revision: 46125

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=46125

  Log:
    test_features.rb: fix up r46123
    
    * test/csv/test_features.rb: no longer `nil` is valid data source
      for `CSV.new`.  [GH-580]

  Modified files:
    trunk/test/csv/test_features.rb
Index: test/csv/test_features.rb
===================================================================
--- test/csv/test_features.rb	(revision 46124)
+++ test/csv/test_features.rb	(revision 46125)
@@ -123,7 +123,9 @@ class TestCSV::Features < TestCSV https://github.com/ruby/ruby/blob/trunk/test/csv/test_features.rb#L123
   end
 
   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
 
   def test_skip_blanks
@@ -283,13 +285,13 @@ class TestCSV::Features < TestCSV https://github.com/ruby/ruby/blob/trunk/test/csv/test_features.rb#L285
 
   def test_accepts_comment_skip_lines_option
     assert_nothing_raised(ArgumentError) do
-      CSV.new nil, :skip_lines => /\A\s*#/
+      CSV.new(@sample_data, :skip_lines => /\A\s*#/)
     end
   end
 
   def test_accepts_comment_defaults_to_nil
-    c = CSV.new nil
-    assert_equal c.skip_lines, nil
+    c = CSV.new(@sample_data)
+    assert_nil(c.skip_lines)
   end
 
   class RegexStub
@@ -297,8 +299,8 @@ class TestCSV::Features < TestCSV https://github.com/ruby/ruby/blob/trunk/test/csv/test_features.rb#L299
 
   def test_requires_skip_lines_to_call_match
     regex_stub = RegexStub.new
-    assert_raise(ArgumentError) do
-      CSV.new nil, :skip_lines => regex_stub
+    assert_raise_with_message(ArgumentError, /skip_lines/) do
+      CSV.new(@sample_data, :skip_lines => regex_stub)
     end
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]