Skip to content

Commit

Permalink
Test non-block version of File#get_output_stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Sep 13, 2020
1 parent e5e3f97 commit d57cfcd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/file_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ def test_get_output_stream
assert_equal(count + 1, zf.size)
assert_equal('Putting stuff in new_entry.txt', zf.read('new_entry.txt'))

zf.get_output_stream(zf.get_entry('test/data/generated/empty.txt')) do |os|
os.write 'Putting stuff in data/generated/empty.txt'
end
# Use the non-block version of `get_output_stream` not tested elsewhere.
ostream =
zf.get_output_stream(zf.get_entry('test/data/generated/empty.txt'))
ostream.write 'Putting stuff in data/generated/empty.txt'
ostream.close

assert_equal(count + 1, zf.size)
assert_equal('Putting stuff in data/generated/empty.txt', zf.read('test/data/generated/empty.txt'))

Expand Down

0 comments on commit d57cfcd

Please sign in to comment.