test/zip_writer_test.rb in iostreams-0.20.3 vs test/zip_writer_test.rb in iostreams-1.0.0.beta
- old
+ new
@@ -10,30 +10,30 @@
let :file_name do
temp_file.path
end
let :decompressed do
- File.read(File.join(File.dirname(__FILE__), 'files', 'text.txt'))
+ ::File.read(File.join(File.dirname(__FILE__), 'files', 'text.txt'))
end
after do
temp_file.delete
end
- describe '.open' do
+ describe '.file' do
it 'file' do
- IOStreams::Zip::Writer.open(file_name, zip_file_name: 'text.txt') do |io|
+ IOStreams::Zip::Writer.file(file_name, entry_file_name: 'text.txt') do |io|
io.write(decompressed)
end
- result = Zip::File.open(file_name) do |zip_file|
+ result = ::Zip::File.open(file_name) do |zip_file|
zip_file.first.get_input_stream.read
end
assert_equal decompressed, result
end
it 'stream' do
io_string = StringIO.new(''.b)
- IOStreams::Zip::Writer.open(io_string) do |io|
+ IOStreams::Zip::Writer.stream(io_string) do |io|
io.write(decompressed)
end
io = StringIO.new(io_string.string)
result = nil
begin