summaryrefslogtreecommitdiff
path: root/spec/unit/provider/service
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-09-06 12:51:07 -0700
committerGitHub <noreply@github.com>2017-09-06 12:51:07 -0700
commit294742ef45336b97cafc1742c6adfd1d6657c710 (patch)
tree9a9e3bf7a1dd98101868d1b418b3f7479faea681 /spec/unit/provider/service
parent38f8845fda94c6640ab905ef84f182db38c5f51f (diff)
parent518b27b7b22468d0ebde0b9370e113d31c8ccf2a (diff)
downloadchef-294742ef45336b97cafc1742c6adfd1d6657c710.tar.gz
Merge pull request #6353 from mikedodge04/launchd2
Launchd should not load launchagents as root.
Diffstat (limited to 'spec/unit/provider/service')
-rw-r--r--spec/unit/provider/service/macosx_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb
index c9dd629187..704c7a802e 100644
--- a/spec/unit/provider/service/macosx_spec.rb
+++ b/spec/unit/provider/service/macosx_spec.rb
@@ -74,7 +74,10 @@ XML
let(:service_label) { "io.redis.redis-server" }
before do
allow(Dir).to receive(:glob).and_return([plist], [])
- allow(Etc).to receive(:getlogin).and_return("igor")
+ @stat = double("File::Stat", { :uid => 501 })
+ allow(File).to receive(:stat).and_return(@stat)
+ @getpwuid = double("Etc::Passwd", { :name => "mikedodge04" })
+ allow(Etc).to receive(:getpwuid).and_return(@getpwuid)
allow(node).to receive(:[]).with("platform_version").and_return(platform_version)
cmd = "launchctl list #{service_label}"
allow(provider).to receive(:shell_out_with_systems_locale).