aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_find.rb
diff options
context:
space:
mode:
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