Skip to content

Commit

Permalink
fix tempfile with binmode
Browse files Browse the repository at this point in the history
  • Loading branch information
piiraa committed Sep 13, 2023
1 parent a3b411c commit 6e1b827
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions spec/bucket_store_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

require "tempfile"

require "pry-byebug"

RSpec.describe BucketStore, :integration do
before do
# Setup AWS connectivity to minio
Expand Down Expand Up @@ -68,17 +66,8 @@
end

after do
if input_temp_file.is_a?(File)
input_temp_file.close
else
input_temp_file.unlink
end

if output_temp_file.is_a?(File)
output_temp_file.close
else
output_temp_file.unlink
end
input_temp_file.unlink
output_temp_file.unlink
end

it "all file are listable on the store" do
Expand Down Expand Up @@ -108,13 +97,13 @@

context "when the files are binary" do
let(:input_temp_file) do
Tempfile.new.binmode.tap do |file|
Tempfile.new(binmode: true).tap do |file|
file.write(Random.bytes(1024))
file.rewind
end
end
let(:output_temp_file) do
Tempfile.new.binmode
Tempfile.new(binmode: true)
end

let(:input_in_memory_buffer) do
Expand Down

0 comments on commit 6e1b827

Please sign in to comment.