From a750308f209bb1688e4c0d5cee6bfae2c611db0a Mon Sep 17 00:00:00 2001 From: Dzmitry Plashchynski Date: Tue, 3 Mar 2015 20:01:10 +0200 Subject: [PATCH] Add specs for pidfile option --- spec/cli_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index b3d16c5..9d21b6f 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -13,6 +13,7 @@ describe Crono::CLI do expect(cli).to receive(:load_rails) expect(cli).to receive(:start_working_loop) expect(cli).to receive(:parse_options) + expect(cli).to receive(:write_pid) cli.run end end @@ -39,6 +40,11 @@ describe Crono::CLI do expect(cli.config.logfile).to be_eql "log/crono.log" end + it "should set pidfile" do + cli.send(:parse_options, ["--pidfile", "tmp/pids/crono.0.log"]) + expect(cli.config.pidfile).to be_eql "tmp/pids/crono.0.log" + end + it "should set daemonize" do cli.send(:parse_options, ["--daemonize"]) expect(cli.config.daemonize).to be true