Sha256: 3c12270901c148eb3571a62539963f0c3559ce856fa3c04b1b39d234c9f31d98

Contents?: true

Size: 657 Bytes

Versions: 2

Compression:

Stored size: 657 Bytes

Contents

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

describe EventCatcher do
  subject { EventCatcher.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" }
          subject.wait_for_created
          logger.debug { "woke up, created must have been delivered" }
        end
        true
      end

      th.run
      Thread.pass until th.status == 'sleep'

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

      subject.add(:created, 'blah')

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zk-1.1.1 spec/event_catcher_spec.rb
zk-1.1.0 spec/event_catcher_spec.rb