mirror of
https://github.com/meineerde/rackstash.git
synced 2025-10-17 14:01:01 +00:00
Add tests for Flow#auto_flush
This commit is contained in:
parent
3b5ff3a4dc
commit
d502bece9c
@ -69,6 +69,50 @@ RSpec.describe Rackstash::Flow do
|
||||
end
|
||||
end
|
||||
|
||||
describe '#auto_flush' do
|
||||
it 'defaults to false' do
|
||||
expect(flow.auto_flush).to eql false
|
||||
end
|
||||
|
||||
it 'sets a boolean value' do
|
||||
flow.auto_flush(true)
|
||||
expect(flow.auto_flush).to eql true
|
||||
expect(flow.auto_flush?).to eql true
|
||||
|
||||
flow.auto_flush(false)
|
||||
expect(flow.auto_flush).to eql false
|
||||
expect(flow.auto_flush?).to eql false
|
||||
|
||||
flow.auto_flush('something')
|
||||
expect(flow.auto_flush).to eql true
|
||||
expect(flow.auto_flush?).to eql true
|
||||
end
|
||||
|
||||
it 'ignores a nil argument' do
|
||||
flow.auto_flush(true)
|
||||
expect(flow.auto_flush).to eql true
|
||||
|
||||
flow.auto_flush(nil)
|
||||
expect(flow.auto_flush?).to eql true
|
||||
end
|
||||
end
|
||||
|
||||
describe '#auto_flush=' do
|
||||
it 'sets a boolean value' do
|
||||
flow.auto_flush = true
|
||||
expect(flow.auto_flush?).to eql true
|
||||
|
||||
flow.auto_flush = false
|
||||
expect(flow.auto_flush?).to eql false
|
||||
|
||||
flow.auto_flush = 'something'
|
||||
expect(flow.auto_flush?).to eql true
|
||||
|
||||
flow.auto_flush = nil
|
||||
expect(flow.auto_flush?).to eql false
|
||||
end
|
||||
end
|
||||
|
||||
describe '#close!' do
|
||||
it 'calls adapter#close' do
|
||||
expect(adapter).to receive(:close).and_return(true)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user