7 require 'mcollective/windows_daemon'
9 describe WindowsDaemon do
10 describe "#daemonize_runner" do
11 it "should only run on the windows platform" do
12 Util.expects("windows?").returns(false)
13 expect { WindowsDaemon.daemonize_runner }.to raise_error("The Windows Daemonizer should only be used on the Windows Platform")
16 it "should not support writing pid files" do
17 expect { WindowsDaemon.daemonize_runner(true) }.to raise_error("Writing pid files are not supported on the Windows Platform")
20 it "should start the mainloop" do
21 WindowsDaemon.expects(:mainloop)
22 WindowsDaemon.daemonize_runner
26 describe "#service_stop" do
27 it "should disconnect and exit" do
31 connector.expects(:disconnect).once
33 PluginManager.expects("[]").with("connector_plugin").returns(connector)
36 d.expects("exit!").once