class
ActiveStorage::Service::DiskServiceReadTest
- ActiveStorage::Service::DiskServiceReadTest
- Minitest::Test
- Minitest::Runnable
- Reference
- Object
Overview
The read side of the same service. The content is written to the sharded path directly, so a read is not asserted through the write that set it up. :nodoc:
Defined in:
active_storage/service/disk_service_test.crConstant Summary
-
CONTENT =
"0123456789abcdef" -
KEY =
"gz0zdzhk0yn6zjhxfzl6qt1ys5rj"
Instance Method Summary
- #setup
- #teardown
- #test_download_chunk_raises_when_nothing_is_stored_for_the_key
- #test_download_chunk_returns_a_range_ending_at_the_last_byte
- #test_download_chunk_returns_the_inclusive_byte_range
-
#test_download_yields_chunks_the_caller_may_keep
The slices are kept instead of being copied with
String.new, which is what catches a buffer reused across reads: the second read used to overwrite the head of the first chunk, so the chunks a caller held no longer joined back into the content.
Instance Method Detail
def test_download_yields_chunks_the_caller_may_keep
#
The slices are kept instead of being copied with String.new, which is what catches a buffer
reused across reads: the second read used to overwrite the head of the first chunk, so the
chunks a caller held no longer joined back into the content.