Sha256: 57339fd6de488648f0a838659243941cf7fb63b687b45aa6f78481fb9e08eefa

Contents?: true

Size: 919 Bytes

Versions: 2

Compression:

Stored size: 919 Bytes

Contents

require 'spec_helper'

describe FluQ::DSL::Feed do

  let(:root) { FluQ::DSL::Root.new FluQ.root.join('../scenario/config/test.rb') }
  subject    { root.feeds.first }

  it  { should be_instance_of(described_class) }
  it  { should have(1).inputs }
  it  { should have(1).handlers }

  it 'should find & configure input' do
    subject.input(:socket) do
      bind 'tcp://localhost:76543'
    end
    subject.should have(2).inputs
    subject.inputs.last.should == [FluQ::Input::Socket, {bind: "tcp://localhost:76543"}]
  end

  it 'should find & configure handler' do
    subject.handler(:log)
    subject.should have(2).handlers
  end

  it 'should find namespaced handler' do
    subject.handler(:custom, :test_handler) do
      to 'tcp://localhost:87654'
    end
    subject.should have(2).handlers
    subject.handlers.last.should == [FluQ::Handler::Custom::TestHandler, {to: "tcp://localhost:87654"}]
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluq-0.8.1 spec/fluq/dsl/feed_spec.rb
fluq-0.8.0 spec/fluq/dsl/feed_spec.rb