summaryrefslogtreecommitdiff
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
commit917bc68772e447c9fe7f86ee1588e13771b992b6 (patch)
tree2491277e96219fad20ca1d2db6b7226fdaf4dce5 /test/test_find.rb
parent16759238ad5a19e784f73a66ba5cacf7ee274262 (diff)
downloadbundler-917bc68772e447c9fe7f86ee1588e13771b992b6.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