1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
ktsj 2017-09-30 03:31:32 +00:00
parent 16759238ad
commit 917bc68772

View file

@ -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