Sha256: 6111bc7dd1974e974fb52102b05e3f87140e3081151d3975a2bdbc60a29e0637

Contents?: true

Size: 596 Bytes

Versions: 8

Compression:

Stored size: 596 Bytes

Contents

require 'spec_helper'

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

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

  let(:response)   { mock('Response') }
  let(:observer_a) { mock('Observer A') }
  let(:observer_b) { mock('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

8 entries across 8 versions & 1 rubygems

Version Path
substation-0.0.8 spec/unit/substation/observer/chain/call_spec.rb
substation-0.0.7 spec/unit/substation/observer/chain/call_spec.rb
substation-0.0.6 spec/unit/substation/observer/chain/call_spec.rb
substation-0.0.5 spec/unit/substation/observer/chain/call_spec.rb
substation-0.0.4 spec/unit/substation/observer/chain/call_spec.rb
substation-0.0.3 spec/unit/substation/observer/chain/call_spec.rb
substation-0.0.2 spec/unit/substation/observer/chain/call_spec.rb
substation-0.0.1 spec/unit/substation/observer/chain/call_spec.rb