Sha256: 4b0d92b99469784767149df22595322fa42ea6bf22ffc1a86ecaba2bbf05d1d3

Contents?: true

Size: 839 Bytes

Versions: 6

Compression:

Stored size: 839 Bytes

Contents

RSpec.describe Mutant::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

6 entries across 6 versions & 1 rubygems

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