Sha256: e29dcfcd6ac4c29a9cc0778435f0ac209afc3a72ac85c4d91cf4decf37ca47fc

Contents?: true

Size: 839 Bytes

Versions: 5

Compression:

Stored size: 839 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_should_behave_like 'a command method'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mutest-0.0.6 spec/unit/mutest/actor/sender_spec.rb
mutest-0.0.5 spec/unit/mutest/actor/sender_spec.rb
mutest-0.0.4 spec/unit/mutest/actor/sender_spec.rb
mutest-0.0.3 spec/unit/mutest/actor/sender_spec.rb
mutest-0.0.2 spec/unit/mutest/actor/sender_spec.rb