Sha256: f7b0895e0530ab0c6ad043fd876725d40258ecc26c80c2014f20e5e83309d1ae

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

require 'spec_helper'

describe Observer::Chain, '#call' do
  subject { object.call(response) }

  let(:object) { Observer::Chain.new(observers) }

  let(:response)   { double('Response') }
  let(:observer_a) { double('Observer A') }
  let(:observer_b) { double('Observer B') }

  let(:observers) { [observer_a, observer_b] }

  it_should_behave_like 'a command method'

  before do
    observer_a.stub(:call)
    observer_b.stub(:call)
  end

  it 'should call observers' do
    observer_a.should_receive(:call).with(response)
    observer_b.should_receive(:call).with(response)
    subject
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
substation-0.0.10.beta2 spec/unit/substation/observer/chain/call_spec.rb