diff --git a/fixtures/async/http/a_protocol.rb b/fixtures/async/http/a_protocol.rb index c20a7def..5fadf4e6 100644 --- a/fixtures/async/http/a_protocol.rb +++ b/fixtures/async/http/a_protocol.rb @@ -301,13 +301,11 @@ def endpoint_options expect(response.body.length).not.to be_nil end - let(:tempfile) {Tempfile.new} - it "can save to disk" do - response.save(tempfile.path) - expect(tempfile.read).to be == expected - - tempfile.close + Tempfile.open do |tempfile| + response.save(tempfile.path) + expect(tempfile.read).to be == expected + end end it "has response header" do