1
0
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:
Holger Just 2017-12-20 21:27:12 +01:00
parent ad4a40413b
commit 43a303b09d
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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)