From 917bc68772e447c9fe7f86ee1588e13771b992b6 Mon Sep 17 00:00:00 2001 From: ktsj Date: Sat, 30 Sep 2017 03:31:32 +0000 Subject: 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 --- test/test_find.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') 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 -- cgit v1.2.3