spec/duke/controller_spec.rb in duke-0.1.4 vs spec/duke/controller_spec.rb in duke-0.1.5
- old
+ new
@@ -87,9 +87,27 @@
TCPSocket.should_receive(:new).with('localhost', 4567).and_return('sockette!')
@controller.ping_command.call.should == 'sockette!'
end
end
+ describe "#running" do
+ context "when port is nil" do
+ it "is false" do
+ @controller.stub(:port).and_return(nil)
+ @controller.running?.should be_false
+ end
+ end
+
+ context "when port is not nil" do
+ it "is delegates to controller" do
+ controller = double("controller")
+ controller.should_receive(:running?).and_return('running?')
+ @controller.stub(:controller).and_return(controller)
+ @controller.running?.should == "running?"
+ end
+ end
+ end
+
describe "#controller" do
it "instantiates a DaemonController" do
@controller.stub(:identifier).and_return("identifier")
@controller.stub(:ping_command).and_return("ping_command")
@controller.stub(:pid_file).and_return("pid_file")
\ No newline at end of file