Skip to content

Commit 917bc68

Browse files
committed
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
1 parent 1675923 commit 917bc68

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/test_find.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,23 @@ def test_encoding_non_ascii
297297
}
298298
end
299299

300+
def test_to_path
301+
c = Class.new {
302+
def initialize(path)
303+
@path = path
304+
end
305+
306+
def to_path
307+
@path
308+
end
309+
}
310+
Dir.mktmpdir {|d|
311+
a = []
312+
Find.find(c.new(d)) {|f| a << f }
313+
assert_equal([d], a)
314+
}
315+
end
316+
300317
class TestInclude < Test::Unit::TestCase
301318
include Find
302319

0 commit comments

Comments
 (0)