Skip to content

Commit dae6a92

Browse files
committed
(PUP-11428) Remove useless test
The test passed an instance of `TestClient` which caused the daemon to call `new` on the instance, and so the daemon appeared to "do nothing", when actually it raised a `NoMethodError`, which was logged, but never printed. Instead pass the `Puppet::Configurer` class.
1 parent 922d9c9 commit dae6a92

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

spec/unit/daemon_spec.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'spec_helper'
22
require 'puppet/daemon'
33
require 'puppet/agent'
4+
require 'puppet/configurer'
45

56
def without_warnings
67
flag = $VERBOSE
@@ -9,12 +10,6 @@ def without_warnings
910
$VERBOSE = flag
1011
end
1112

12-
class TestClient
13-
def lockfile_path
14-
"/dev/null"
15-
end
16-
end
17-
1813
describe Puppet::Daemon, :unless => Puppet::Util::Platform.windows? do
1914
include PuppetSpec::Files
2015

@@ -26,7 +21,7 @@ def run_loop(jobs)
2621
end
2722
end
2823

29-
let(:agent) { Puppet::Agent.new(TestClient.new, false) }
24+
let(:agent) { Puppet::Agent.new(Puppet::Configurer, false) }
3025
let(:server) { double("Server", :start => nil, :wait_for_shutdown => nil) }
3126

3227
let(:pidfile) { double("PidFile", :lock => true, :unlock => true, :file_path => 'fake.pid') }
@@ -131,10 +126,6 @@ def run_loop(jobs)
131126
end
132127

133128
describe "when reloading" do
134-
it "should do nothing if no agent is configured" do
135-
daemon.reload
136-
end
137-
138129
it "should do nothing if the agent is running" do
139130
expect(agent).to receive(:run).with({:splay => false}).and_raise(Puppet::LockError, 'Failed to aquire lock')
140131
expect(Puppet).to receive(:notice).with('Not triggering already-running agent')

0 commit comments

Comments
 (0)