summaryrefslogtreecommitdiff
path: root/spec/unit/agent_spec.rb
diff options
context:
space:
mode:
authorStig Sandbeck Mathisen <ssm@debian.org>2012-01-26 11:22:40 +0100
committerStig Sandbeck Mathisen <ssm@debian.org>2012-01-26 11:22:40 +0100
commitc17b3ba16e7013f06416f10b8752ef783f048717 (patch)
tree790f13f167199b954007e17d1c55a8d1b0218775 /spec/unit/agent_spec.rb
parent32af6143486ceb24a93636445d1883f5fe2299d7 (diff)
downloadpuppet-upstream/2.7.10.tar.gz
Imported Upstream version 2.7.10upstream/2.7.10
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)