Sha256: 26efe945de0930536e8e423436dbf0470f8d18fc593b3b4719bc1a62763edbc5

Contents?: true

Size: 883 Bytes

Versions: 12

Compression:

Stored size: 883 Bytes

Contents

require 'test_helper'

class EbEventPollerTest < Test::Unit::TestCase
  def setup
    @eb = EBStub.new
    @poller = EbDeployer::EventPoller.new(EbDeployer::EbEventSource.new("myapp", "test", @eb))
  end

  def test_run_handle_block_through_all_events_when_there_is_no_from_anchor
    messages_handled = []
    @eb.set_events('myapp', 'test', ['a', 'b', nil])
    @poller.poll(nil) do |event|
      break if event[:message].nil?
      messages_handled << event[:message]
    end

    assert_equal ['a', 'b'], messages_handled
  end


  def test_can_poll_all_events_after_an_anchor
    @eb.set_events('myapp', 'test', ['a', 'b'], ['c', 'd', nil])
    anchor = @poller.get_anchor
    messages_handled = []
    @poller.poll(anchor) do |event|
      break if event[:message].nil?
      messages_handled << event[:message]
    end

    assert_equal ['c', 'd'], messages_handled
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
man_eb_deployer-0.8.0 test/eb_event_poller_test.rb
eb_deployer_updated-0.8.1 test/eb_event_poller_test.rb
eb_deployer_updated-0.8.0 test/eb_event_poller_test.rb
eb_deployer-0.7.0 test/eb_event_poller_test.rb
eb_deployer-0.6.6 test/eb_event_poller_test.rb
eb_deployer-0.6.5 test/eb_event_poller_test.rb
eb_deployer-0.6.4 test/eb_event_poller_test.rb
eb_deployer-0.6.3 test/eb_event_poller_test.rb
eb_deployer-0.6.2 test/eb_event_poller_test.rb
eb_deployer-0.6.1 test/eb_event_poller_test.rb
eb_deployer-0.6.0 test/eb_event_poller_test.rb
eb_deployer-0.6.0.beta6 test/eb_event_poller_test.rb