Sha256: d45fc9d013a422a28ee2273ac89fd49b640bd33146b7b80e5be339ed5a267313

Contents?: true

Size: 494 Bytes

Versions: 2

Compression:

Stored size: 494 Bytes

Contents

require 'spec_helper'

describe PbActor::Message do
  before :each do
    @r, @w = IO.pipe
  end

  after :each do
    [@r, @w].each do |io|
      io.close unless io.closed?
    end
  end

  it 'send should broken when read io close' do
    @r.close
    expect{PbActor::Message.send "message", @w}.to raise_error(PbActor::DeadActorError)
  end

  it 'recv should broken when write io close' do
    @w.close
    expect{PbActor::Message.recv @r}.to raise_error(PbActor::DeadActorError)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pb_actor-0.0.5 spec/message_spec.rb
pb_actor-0.0.4 spec/message_spec.rb