summaryrefslogtreecommitdiffstats
path: root/lib/pathname.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-24 11:56:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-24 11:56:50 +0000
commit8f7b1e3db72298ed3ed3c59ec75a98658de898c3 (patch)
tree2a9db2a5fa0e517126688975c010e17c41a33b0d /lib/pathname.rb
parent6c1ade0090763a1a654c8f376c7ef3e61088fa86 (diff)
downloadruby-8f7b1e3db72298ed3ed3c59ec75a98658de898c3.tar.gz
ruby-8f7b1e3db72298ed3ed3c59ec75a98658de898c3.tar.xz
ruby-8f7b1e3db72298ed3ed3c59ec75a98658de898c3.zip
test Kernel.open accepts pathname object.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/pathname.rb')
-rw-r--r--lib/pathname.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb
index 4d05b6f38..c4d0ea586 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