diff options
Diffstat (limited to 'test/test_tempfile.rb')
-rw-r--r-- | test/test_tempfile.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb index 87c1241df8..d5d684b016 100644 --- a/test/test_tempfile.rb +++ b/test/test_tempfile.rb @@ -63,6 +63,22 @@ class TestTempfile < Test::Unit::TestCase assert_match(/\.txt$/, File.basename(t.path)) end + def test_dup + t = tempfile + t2 = t.dup + t2.close + assert_equal true, t2.closed? + assert_equal false, t.closed? + end + + def test_clone + t = tempfile + t2 = t.clone + t2.close + assert_equal true, t2.closed? + assert_equal false, t.closed? + end + def test_unlink t = tempfile("foo") path = t.path |