diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-24 11:56:50 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-24 11:56:50 +0000 |
| commit | 24dedd5255d5aadf874cc94a64b28cb89ec02a16 (patch) | |
| tree | 65a98343e73eedf799f5d70781bbbfcd1e50fc22 | |
| parent | 9f9d7e01db0296edf5b2a5a947a17c2a5d4cf030 (diff) | |
| download | ruby-24dedd5255d5aadf874cc94a64b28cb89ec02a16.tar.gz ruby-24dedd5255d5aadf874cc94a64b28cb89ec02a16.tar.xz ruby-24dedd5255d5aadf874cc94a64b28cb89ec02a16.zip | |
test Kernel.open accepts pathname object.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | lib/pathname.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb index 889bbf0fc..ac420a5ca 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -1170,5 +1170,20 @@ if $0 == __FILE__ assert_not_same(str, obj.to_s) assert_not_same(obj.to_s, obj.to_s) end + + def test_kernel_open + 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 |
