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