From 614537d5fa13f72e8c1eaf55a322697a7aadb898 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 24 May 2004 11:56:50 +0000 Subject: [PATCH] test Kernel.open accepts pathname object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/pathname.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/pathname.rb b/lib/pathname.rb index 4d05b6f38c..c4d0ea586a 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -1180,7 +1180,18 @@ if $0 == __FILE__ end def test_kernel_open - assert_equal(1, Kernel.open(Pathname.new("/dev/null")) {|f| 1 }) + count = 0 + stat1 = File.stat(__FILE__) + result = Kernel.open(Pathname.new(__FILE__)) {|f| + stat2 = f.stat + assert_equal(stat1.dev, stat2.dev) + assert_equal(stat1.ino, stat2.ino) + assert_equal(stat1.size, stat2.size) + count += 1 + 2 + } + assert_equal(1, count) + assert_equal(2, result) end end end