summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@chef.io>2020-03-08 15:32:08 -0700
committerGitHub <noreply@github.com>2020-03-08 15:32:08 -0700
commit15b8e2c9b5a24f7b8cd1dc2b9a3042da5b549136 (patch)
tree9d39f68cce119bce352aeeaa38d43e21f39e0a35
parent528ebf0f545d9bc0ef1d3f129134818855b1cf45 (diff)
parent1d47f8f55c9c1b65712adf7d6d48d91aed8b4514 (diff)
downloadmixlib-shellout-15b8e2c9b5a24f7b8cd1dc2b9a3042da5b549136.tar.gz
Merge pull request #203 from terceiro/fix-test-env-user
shellout_spec: make "current user" independent of the environment
-rw-r--r--spec/mixlib/shellout_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index ed5e30a..da3e543 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -1,4 +1,5 @@
require "spec_helper"
+require "etc"
require "logger"
require "timeout"
@@ -1532,7 +1533,7 @@ describe Mixlib::ShellOut do
context "when no user is set" do
it "should run as current user" do
- expect(running_user).to eql(ENV["USER"])
+ expect(running_user).to eql(Etc.getpwuid.name)
end
end