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

ruby-changes:47952

From: ktsj <ko1@a...>
Date: Sat, 30 Sep 2017 12:31:37 +0900 (JST)
Subject: [ruby-changes:47952] ktsj:r60067 (trunk): test_find.rb: improve branch coverage

ktsj	2017-09-30 12:31:32 +0900 (Sat, 30 Sep 2017)

  New Revision: 60067

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60067

  Log:
    test_find.rb: improve branch coverage
    
    * test/test_find.rb (test_to_path): add a test
      for to_path conversion.

  Modified files:
    trunk/test/test_find.rb
Index: test/test_find.rb
===================================================================
--- test/test_find.rb	(revision 60066)
+++ test/test_find.rb	(revision 60067)
@@ -297,6 +297,23 @@ class TestFind < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_find.rb#L297
     }
   end
 
+  def test_to_path
+    c = Class.new {
+      def initialize(path)
+        @path = path
+      end
+
+      def to_path
+        @path
+      end
+    }
+    Dir.mktmpdir {|d|
+      a = []
+      Find.find(c.new(d)) {|f| a << f }
+      assert_equal([d], a)
+    }
+  end
+
   class TestInclude < Test::Unit::TestCase
     include Find
 

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

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