aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_find.rb
diff options
context:
space:
mode:
authorktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-30 03:31:32 +0000
committerktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-30 03:31:32 +0000
commit7dfbdb44a79ed5f566e879d0b4858f1d15796cb3 (patch)
tree2491277e96219fad20ca1d2db6b7226fdaf4dce5 /test/test_find.rb
parentfbcef46633d8e255aef0075b81e32d8e2ab2eb0e (diff)
downloadruby-7dfbdb44a79ed5f566e879d0b4858f1d15796cb3.tar.gz
test_find.rb: improve branch coverage
* test/test_find.rb (test_to_path): add a test for to_path conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_find.rb')
-rw-r--r--test/test_find.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_find.rb b/test/test_find.rb
index fddb5dfaf7..d4d958859d 100644
--- a/test/test_find.rb
+++ b/test/test_find.rb
@@ -297,6 +297,23 @@ class TestFind < Test::Unit::TestCase
}
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