spec/conductor_spec.rb in torkify-0.0.1 vs spec/conductor_spec.rb in torkify-0.0.2

- old
+ new

@@ -1,14 +1,13 @@ require 'spec_helper' require 'torkify/conductor' -require 'torkify/observer_set' module Torkify describe Conductor do before do @reader = double - @observers = Torkify::ObserverSet.new + @observers = Set.new @conductor = Conductor.new @observers end subject { @conductor } @@ -36,18 +35,18 @@ o.should_receive(:on_shutdown) end end it "should call startup and shutdown on each observer and each_line on reader" do - @reader.should_receive(:each_line) + @reader.should_receive(:gets).and_return nil @conductor.start @reader end end context "when start is called with dummy input" do before do line = '["test","spec/status_change_event_spec.rb",[],"spec/status_change_event_spec.rb.log",0]' - @reader.should_receive(:each_line).and_yield(line) + @reader.should_receive(:gets).and_return(line, nil) @conductor.observers += [double, double] end it "should notify each observer about the test event" do @conductor.observers.each do |o|