Sha256: 8e88652da6ba2ea0721c5a85c0b7c3312cfa97e3d736028a10dcf6de0e61e644

Contents?: true

Size: 755 Bytes

Versions: 16

Compression:

Stored size: 755 Bytes

Contents

require 'spec_helper'
require 'hamster/experimental/mutable_set'

describe 'Tapping into with group identifier' do
  let(:deliverer) { Freddy.build(logger, config) }
  let(:responder1) { Freddy.build(logger, config) }
  let(:responder2) { Freddy.build(logger, config) }

  let(:destination)  { random_destination }

  after { [deliverer, responder1, responder2].each(&:close) }

  it 'receives a message once' do
    msg_counter = Hamster::MutableSet[]

    group_id = arbitrary_id
    responder1.tap_into(destination, group: group_id) {|msg| msg_counter << 'r1' }
    responder2.tap_into(destination, group: group_id) {|msg| msg_counter << 'r2' }
    deliverer.deliver(destination, {})

    default_sleep
    expect(msg_counter.count).to eq(1)
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
freddy-1.4.1 spec/integration/tap_into_with_group_spec.rb
freddy-1.4.0 spec/integration/tap_into_with_group_spec.rb
freddy-1.3.3 spec/integration/tap_into_with_group_spec.rb
freddy-jruby-1.3.2 spec/integration/tap_into_with_group_spec.rb
freddy-1.3.2 spec/integration/tap_into_with_group_spec.rb
freddy-1.3.1 spec/integration/tap_into_with_group_spec.rb
freddy-1.3.0 spec/integration/tap_into_with_group_spec.rb
freddy-1.2.0 spec/integration/tap_into_with_group_spec.rb
freddy-1.1.0 spec/integration/tap_into_with_group_spec.rb
freddy-1.0.1 spec/integration/tap_into_with_group_spec.rb
freddy-jruby-1.0.0 spec/integration/tap_into_with_group_spec.rb
freddy-1.0.0 spec/integration/tap_into_with_group_spec.rb
freddy-jruby-0.7.2 spec/integration/tap_into_with_group_spec.rb
freddy-0.7.2 spec/integration/tap_into_with_group_spec.rb
freddy-0.7.1 spec/integration/tap_into_with_group_spec.rb
freddy-0.7.0 spec/integration/tap_into_with_group_spec.rb