mirror of
https://github.com/meineerde/rackstash.git
synced 2026-01-31 17:27:13 +00:00
Include Enumerable module into Flows
This commit is contained in:
parent
ad4a40413b
commit
43a303b09d
@ -14,6 +14,8 @@ module Rackstash
|
||||
# used to write a single log event of a {Buffer} to multiple flows. Each
|
||||
# {Logger} object has an associated Flows object to define the logger's flows.
|
||||
class Flows
|
||||
include ::Enumerable
|
||||
|
||||
# @param flows [::Array<Flow, Adapter::Adapter, Object>] the {Flow} objects
|
||||
# which should be part of the list. If any of the arguments is not a
|
||||
# {Flow} already, we assume it is an adapter and create a new {Flow} for
|
||||
|
||||
@ -19,6 +19,14 @@ describe Rackstash::Flows do
|
||||
flow
|
||||
end
|
||||
|
||||
it 'is an Enumerable' do
|
||||
expect(described_class).to be < Enumerable
|
||||
expect(::Enumerable.public_instance_methods - flows.methods)
|
||||
.to be_empty
|
||||
|
||||
expect(flows.map {}).to eql []
|
||||
end
|
||||
|
||||
describe '#initialize' do
|
||||
it 'accepts a single flow' do
|
||||
list = described_class.new(a_flow)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user