Sha256: 9f687cdbacd8dc5f0d036398e81dacc092b64871bb8070545765f672719481e9

Contents?: true

Size: 488 Bytes

Versions: 15

Compression:

Stored size: 488 Bytes

Contents

module RevealCK
  module Commands
    describe ThreadWaker do
      describe '#run' do
        it 'wakes up an associated thread periodically' do
          signal = false
          signal_changer = Thread.new do
            # This sleep will be infinite unless someone wakes it up..
            sleep
            signal = true
          end
          ThreadWaker.new(signal_changer, 0.1).run
          sleep 0.2
          expect(signal).to eq true
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
reveal-ck-3.9.2 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.9.1 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.9.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.8.1 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.8.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.7.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.6.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.5.1 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.5.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.4.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.3.1 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.3.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.2.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.1.0 spec/lib/reveal-ck/commands/thread_waker_spec.rb
reveal-ck-3.0.1 spec/lib/reveal-ck/commands/thread_waker_spec.rb