spec/unit/daemon_spec.rb in chef-10.34.6 vs spec/unit/daemon_spec.rb in chef-11.0.0.beta.0

- old
+ new

@@ -148,35 +148,14 @@ before do File.stub!(:exists?).with("/var/run/chef/chef-client.pid").and_return(true) end - describe "and contains the current pid" do - - before do - File.stub!(:read).with("/var/run/chef/chef-client.pid").and_return("#$$\n") - end - - it "should remove the file" do - FileUtils.should_receive(:rm).with("/var/run/chef/chef-client.pid") - Chef::Daemon.remove_pid_file - end - + it "should remove the file" do + FileUtils.should_receive(:rm).with("/var/run/chef/chef-client.pid") + Chef::Daemon.remove_pid_file end - describe "and contains a different pid" do - - before do - other_pid = Process.pid + 1 - File.stub!(:read).with("/var/run/chef/chef-client.pid").and_return("#{other_pid}\n") - end - - it "should not remove the file" do - FileUtils.should_not_receive(:rm) - Chef::Daemon.remove_pid_file - end - - end end describe "when the pid file does not exist" do