spec/unit/runner_spec.rb in mcollective-client-2.6.1 vs spec/unit/runner_spec.rb in mcollective-client-2.7.0

- old
+ new

@@ -179,9 +179,27 @@ Log.expects(:error).with('Cannot unpause MCollective when it is not paused') runner.resume end end + describe '#start_receiver_thread' do + let(:current) do + mock('current thread') + end + + before :each do + Thread.stubs(:new).yields + Thread.stubs(:current).returns(current) + end + + it 'should reraise exceptions' do + runner.instance_variable_set(:@state, :running) + runner.stubs(:receiver_thread).raises('test error') + current.expects(:raise).once + runner.send(:start_receiver_thread) + end + end + describe '#receiver_thread' do let(:runner) do Runner.new(nil) end