summaryrefslogtreecommitdiff
path: root/test/test_tempfile.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_tempfile.rb')
-rw-r--r--test/test_tempfile.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb
index c8af2f5b4d..21edf39776 100644
--- a/test/test_tempfile.rb
+++ b/test/test_tempfile.rb
@@ -243,6 +243,13 @@ puts Tempfile.new('foo').path
assert_equal 5, t.size
end
+ def test_size_on_empty_file
+ t = tempfile("foo")
+ t.write("")
+ t.close
+ assert_equal 0, t.size
+ end
+
def test_concurrency
threads = []
tempfiles = []