Sha256: 95f2cc1e85cb494e64b01f286933b4f35462af094d978b4f9a1509b6a86da92a

Contents?: true

Size: 833 Bytes

Versions: 4

Compression:

Stored size: 833 Bytes

Contents

RSpec.describe Mutest::Actor::Sender do
  let(:object) { described_class.new(condition_variable, mutex, messages) }

  let(:condition_variable) { instance_double(ConditionVariable) }
  let(:mutex)              { instance_double(Mutex)             }
  let(:messages)           { instance_double(Array)             }
  let(:type)               { instance_double(Symbol)            }
  let(:payload)            { instance_double(Object)            }
  let(:_message)           { message(type, payload)             }

  describe '#call' do
    subject { object.call(_message) }

    before do
      expect(mutex).to receive(:synchronize).ordered.and_yield
      expect(messages).to receive(:<<).with(_message).ordered
      expect(condition_variable).to receive(:signal).ordered
    end

    it_behaves_like 'a command method'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mutest-0.0.10 spec/unit/mutest/actor/sender_spec.rb
mutest-0.0.9 spec/unit/mutest/actor/sender_spec.rb
mutest-0.0.8 spec/unit/mutest/actor/sender_spec.rb
mutest-0.0.7 spec/unit/mutest/actor/sender_spec.rb