Sha256: 6625c376b5ecf283878d6167900e76ca15321866a3551a08fbdcbbbfbc055753

Contents?: true

Size: 672 Bytes

Versions: 30

Compression:

Stored size: 672 Bytes

Contents

# quick tests for one of the support classes
require 'spec_helper'

describe EventCatcher do
  subject { EventCatcher.new }

  let!(:latch) { Latch.new }

  describe :wait_for do
    it %[should wake when an event is delivered] do

      th = Thread.new do
        subject.synchronize do
          logger.debug { "about to wait for created" }
          latch.release
          subject.wait_for_created
          logger.debug { "woke up, created must have been delivered" }
        end
        true
      end

      latch.await

      logger.debug { "th.status: #{th.status}" }

      subject.add(:created, 'blah')

      th.join(2).value.should be_true
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
zk-1.9.6 spec/event_catcher_spec.rb
zk-1.9.5 spec/event_catcher_spec.rb
zk-1.9.4 spec/event_catcher_spec.rb
zk-1.9.3 spec/event_catcher_spec.rb
zk-1.9.2 spec/event_catcher_spec.rb
zk-1.9.1 spec/event_catcher_spec.rb
zk-1.9.0 spec/event_catcher_spec.rb
zk-1.8.0 spec/event_catcher_spec.rb
zk-1.7.5 spec/event_catcher_spec.rb
zk-1.7.4 spec/event_catcher_spec.rb
zk-1.7.3 spec/event_catcher_spec.rb
zk-1.7.2 spec/event_catcher_spec.rb
zk-1.7.1 spec/event_catcher_spec.rb
zk-1.7.0 spec/event_catcher_spec.rb
zk-1.6.5 spec/event_catcher_spec.rb
zk-1.6.4 spec/event_catcher_spec.rb
zk-1.6.3 spec/event_catcher_spec.rb
zk-1.6.2 spec/event_catcher_spec.rb
zk-1.6.1 spec/event_catcher_spec.rb
zk-1.6.0 spec/event_catcher_spec.rb