Sha256: 4f2836eb13700c23f2f05ffdcdcd5ca1c370f54431836cab81d09f0d086f6f64

Contents?: true

Size: 748 Bytes

Versions: 30

Compression:

Stored size: 748 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

module Cucumber
  describe Broadcaster do
    
    it "should broadcast methods to registered objects" do
      broadcaster = Broadcaster.new
      mock_receiver = mock('receiver')
      
      mock_receiver.should_receive(:konbanwa).with('good evening')
      broadcaster.register(mock_receiver)
      
      broadcaster.konbanwa('good evening')
    end

    it "should not call methods on registered objects if they dont support the method" do
      broadcaster = Broadcaster.new
      mock_receiver = mock('receiver', :respond_to? => false)

      mock_receiver.should_not_receive(:konbanwa)
      broadcaster.register(mock_receiver)
      
      broadcaster.konbanwa()
    end
    
  end
end

Version data entries

30 entries across 30 versions & 5 rubygems

Version Path
aslakhellesoy-cucumber-0.1.10 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.11 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.12 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.13.2 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.13.3 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.13 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.14.1 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.14.2 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.15 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.16.1 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.16.2 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.16.3 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.16.4 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.16 spec/cucumber/broadcaster_spec.rb
aslakhellesoy-cucumber-0.1.9 spec/cucumber/broadcaster_spec.rb
bts-cucumber-0.1.13.1 spec/cucumber/broadcaster_spec.rb
bts-cucumber-0.1.13.2 spec/cucumber/broadcaster_spec.rb
bts-cucumber-0.1.13.3 spec/cucumber/broadcaster_spec.rb
jeffrafter-cucumber-0.1.10 spec/cucumber/broadcaster_spec.rb
jeffrafter-cucumber-0.1.12 spec/cucumber/broadcaster_spec.rb