Sha256: 7c69b2a6b47bc3c1c1c210346ad624aa10092fb02c2ef4dab5522f73985b19c9

Contents?: true

Size: 733 Bytes

Versions: 4

Compression:

Stored size: 733 Bytes

Contents

require File.dirname(__FILE__) + "/../test_helper"

module DeepTest
  unit_tests do
    test "forwards methods defined in NullListener to all listeners" do
      listener_1, listener_2 = mock, mock
      list = ListenerList.new([listener_1, listener_2])
      listener_1.expects(:starting).with(:agent)
      listener_2.expects(:starting).with(:agent)
      listener_1.expects(:starting_work).with(:agent, :work)
      listener_2.expects(:starting_work).with(:agent, :work)
      list.starting(:agent)
      list.starting_work(:agent, :work)
    end

    test "doesn't forward methods not defined in NullListener" do
      listener = mock
      listener.expects(:to_s).never
      ListenerList.new([listener]).to_s
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
deep_test_pre-2.0 test/deep_test/listener_list_test.rb
jstorimer-deep-test-2.0.0 test/deep_test/listener_list_test.rb
jstorimer-deep-test-0.2.0 test/deep_test/listener_list_test.rb
jstorimer-deep-test-0.1.0 test/deep_test/listener_list_test.rb