1
0
mirror of https://github.com/meineerde/rackstash.git synced 2026-02-01 01:37:12 +00:00

Close a tempfile before attemting to rename it in File specs

This is required on Windows which stubornly refused to rename opened
files by default.
This commit is contained in:
Holger Just 2017-07-28 00:21:28 +02:00
parent 68d674668a
commit c79f2e45d3

View File

@ -146,6 +146,11 @@ RSpec.describe Rackstash::Adapter::File do
context 'with auto_reopen: true' do
let(:adapter_args) { { auto_reopen: true } }
before(:each) do
logfile.close
GC.start
end
it 'reopens the file if moved' do
expect(adapter.auto_reopen?).to eql true
@ -162,6 +167,11 @@ RSpec.describe Rackstash::Adapter::File do
context 'with auto_reopen: false' do
let(:adapter_args) { { auto_reopen: false } }
before(:each) do
logfile.close
GC.start
end
it 'does not reopen the logfile automatically' do
expect(adapter.auto_reopen?).to eql false