summaryrefslogtreecommitdiff
path: root/spec/unit/agent_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/agent_spec.rb')
-rwxr-xr-xspec/unit/agent_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/agent_spec.rb b/spec/unit/agent_spec.rb
index d955868a0..9e2840c58 100755
--- a/spec/unit/agent_spec.rb
+++ b/spec/unit/agent_spec.rb
@@ -24,6 +24,7 @@ describe Puppet::Agent do
# So we don't actually try to hit the filesystem.
@agent.stubs(:lock).yields
+ @agent.stubs(:disabled?).returns(false)
# make Puppet::Application safe for stubbing; restore in an :after block; silence warnings for this.
without_warnings { Puppet::Application = Class.new(Puppet::Application) }
@@ -76,6 +77,7 @@ describe Puppet::Agent do
describe "when being run" do
before do
+ AgentTestClient.stubs(:lockfile_path).returns "/my/lock"
@agent.stubs(:running?).returns false
end
@@ -92,6 +94,12 @@ describe Puppet::Agent do
@agent.run
end
+ it "should do nothing if disabled" do
+ @agent.expects(:disabled?).returns(true)
+ AgentTestClient.expects(:new).never
+ @agent.run
+ end
+
it "should use Puppet::Application.controlled_run to manage process state behavior" do
calls = sequence('calls')
Puppet::Application.expects(:controlled_run).yields.in_sequence(calls)