Sha256: eebd3a1cf2bc0fe36b6efd579c58eb296966cdc1157a0119782e544d65d98b4b

Contents?: true

Size: 816 Bytes

Versions: 1

Compression:

Stored size: 816 Bytes

Contents

RSpec.describe Mutant::Actor do
  let(:mutex) { double('Mutex') }
  let(:thread)  { double('Thread') }

  before do
    expect(Mutex).to receive(:new).and_return(mutex)
  end

  describe Mutant::Actor::Actor do
    let(:mailbox) { Mutant::Actor::Mailbox.new }

    let(:object) { described_class.new(thread, mailbox) }

    describe '#bind' do
      let(:other) { double('Sender') }

      subject { object.bind(other) }

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

    describe '#sender' do
      subject { object.sender }
      it { should eql(Mutant::Actor::Sender.new(thread, mutex, [])) }
    end

    describe '#receiver' do
      subject { object.receiver }

      it 'returns receiver' do
        should eql(Mutant::Actor::Receiver.new(mutex, []))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mutant-0.7.1 spec/unit/mutant/actor/actor_spec.rb