Sha256: 9abde9834e97db5021e2ea8ba008454fd50193c4b63b885c437fec6a83dd7edd

Contents?: true

Size: 826 Bytes

Versions: 5

Compression:

Stored size: 826 Bytes

Contents

RSpec.describe Mutant::Actor::Mailbox do
  let(:mutex)              { instance_double(Mutex)             }
  let(:condition_variable) { instance_double(ConditionVariable) }

  before do
    allow(Mutex).to receive(:new).and_return(mutex)
    allow(ConditionVariable).to receive(:new).and_return(condition_variable)
  end

  describe '.new' do
    subject { described_class.new }

    its(:sender) { should eql(Mutant::Actor::Sender.new(condition_variable, mutex, [])) }
    its(:receiver) { should eql(Mutant::Actor::Receiver.new(condition_variable, mutex, [])) }

  end

  describe '#bind' do
    let(:object) { described_class.new                    }
    let(:other)  { instance_double(Mutant::Actor::Sender) }

    subject { object.bind(other) }

    it { should eql(Mutant::Actor::Binding.new(object, other)) }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mutant-0.8.16 spec/unit/mutant/actor/mailbox_spec.rb
mutant-0.8.15 spec/unit/mutant/actor/mailbox_spec.rb
mutant-0.8.14 spec/unit/mutant/actor/mailbox_spec.rb
mutant-0.8.13 spec/unit/mutant/actor/mailbox_spec.rb
mutant-0.8.12 spec/unit/mutant/actor/mailbox_spec.rb