spec/lib/flapjack/coordinator_spec.rb in flapjack-0.7.29 vs spec/lib/flapjack/coordinator_spec.rb in flapjack-0.7.30
- old
+ new
@@ -15,11 +15,11 @@
Flapjack::Logger.should_receive(:new).and_return(logger)
cfg = {'processor' => {'enabled' => true}}
EM.should_receive(:synchrony).and_yield
config.should_receive(:for_redis).and_return({})
- config.should_receive(:all).and_return(cfg)
+ config.should_receive(:all).twice.and_return(cfg)
processor = double('processor')
processor.should_receive(:start)
processor.should_receive(:stop)
processor.should_receive(:update_status)
@@ -49,11 +49,11 @@
logger.should_receive(:fatal)
cfg = {'processor' => {'enabled' => true}}
EM.should_receive(:synchrony).and_yield
config.should_receive(:for_redis).and_return({})
- config.should_receive(:all).and_return(cfg)
+ config.should_receive(:all).twice.and_return(cfg)
processor = double('processor')
processor.should_receive(:start).and_raise(RuntimeError)
processor.should_receive(:stop)
processor.should_receive(:update_status)
@@ -80,11 +80,11 @@
it "loads an old executive pikelet config block with no new data" do
cfg = {'executive' => {'enabled' => true}}
EM.should_receive(:synchrony).and_yield
config.should_receive(:for_redis).and_return({})
- config.should_receive(:all).and_return(cfg)
+ config.should_receive(:all).twice.and_return(cfg)
processor = double('processor')
processor.should_receive(:start)
processor.should_receive(:stop)
processor.should_receive(:update_status)
@@ -123,11 +123,11 @@
'processor' => {'foo' => 'bar'},
'notifier' => {'enabled' => false}
}
EM.should_receive(:synchrony).and_yield
config.should_receive(:for_redis).and_return({})
- config.should_receive(:all).and_return(cfg)
+ config.should_receive(:all).twice.and_return(cfg)
processor = double('processor')
processor.should_receive(:start)
processor.should_receive(:stop)
processor.should_receive(:update_status)
@@ -161,10 +161,11 @@
Kernel.should_receive(:trap).with('INT').and_yield
Kernel.should_receive(:trap).with('TERM').and_yield
Kernel.should_receive(:trap).with('QUIT').and_yield
Kernel.should_receive(:trap).with('HUP').and_yield
+ config.should_receive(:all).and_return({})
config.should_receive(:for_redis).and_return({})
fc = Flapjack::Coordinator.new(config)
fc.should_receive(:stop).exactly(3).times
fc.should_receive(:reload)
@@ -179,10 +180,11 @@
Kernel.should_receive(:trap).with('INT').and_yield
Kernel.should_receive(:trap).with('TERM').and_yield
Kernel.should_not_receive(:trap).with('QUIT')
Kernel.should_not_receive(:trap).with('HUP')
+ config.should_receive(:all).and_return({})
config.should_receive(:for_redis).and_return({})
fc = Flapjack::Coordinator.new(config)
fc.should_receive(:stop).twice
fc.send(:setup_signals)
@@ -195,11 +197,11 @@
new_cfg = {'gateways' => {'jabber' => {'enabled' => true}}}
new_config = double('new_config')
filename = double('filename')
- config.should_receive(:all).and_return(old_cfg)
+ config.should_receive(:all).twice.and_return(old_cfg)
config.should_receive(:filename).and_return(filename)
Flapjack::Configuration.should_receive(:new).and_return(new_config)
new_config.should_receive(:load).with(filename)
new_config.should_receive(:all).and_return(new_cfg)
@@ -238,11 +240,11 @@
new_cfg = {'processor' => {'enabled' => true, 'foo' => 'baz'}}
new_config = double('new_config')
filename = double('filename')
- config.should_receive(:all).and_return(old_cfg)
+ config.should_receive(:all).twice.and_return(old_cfg)
config.should_receive(:filename).and_return(filename)
Flapjack::Configuration.should_receive(:new).and_return(new_config)
new_config.should_receive(:load).with(filename)
new_config.should_receive(:all).and_return(new_cfg)
@@ -268,10 +270,10 @@
new_cfg = {'processor' => {'enabled' => true, 'baz' => 'qux'}}
new_config = double('new_config')
filename = double('filename')
- config.should_receive(:all).and_return(old_cfg)
+ config.should_receive(:all).twice.and_return(old_cfg)
config.should_receive(:filename).and_return(filename)
Flapjack::Configuration.should_receive(:new).and_return(new_config)
new_config.should_receive(:load).with(filename)
new_config.should_receive(:all).and_return(new_cfg)