summaryrefslogtreecommitdiff
path: root/spec/support/chef_helpers.rb
diff options
context:
space:
mode:
authorChris Doherty <cdoherty@getchef.com>2014-10-21 14:09:04 -0700
committerChris Doherty <cdoherty@getchef.com>2014-12-19 16:24:03 -0800
commitbe28ba90bde1fe0240f313151e3d564ce57e8b29 (patch)
treeae83d0079f55c07452dba11982d1e73f76638368 /spec/support/chef_helpers.rb
parent3569079f9831b5e14e8e46b51840f3b6a069d9eb (diff)
downloadchef-be28ba90bde1fe0240f313151e3d564ce57e8b29.tar.gz
Enable Windows services to run as a different user (CHEF-4921). This adds :run_as_user andcdoherty-enhance-win-service
:run_as_password attributes to the windows_service resource. If a logon user is specified, the resource will (on every run) grant the logon-as-service privilege to that user, using secedit.exe.
Diffstat (limited to 'spec/support/chef_helpers.rb')
-rw-r--r--spec/support/chef_helpers.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/support/chef_helpers.rb b/spec/support/chef_helpers.rb
index 237543748c..851b1dce0a 100644
--- a/spec/support/chef_helpers.rb
+++ b/spec/support/chef_helpers.rb
@@ -67,15 +67,15 @@ end
# win32/service gem. windows_service_manager tests create a windows
# service that starts with the system ruby and requires this gem.
def system_windows_service_gem?
- windows_service_gem_check_command = "ruby -e 'require \"win32/daemon\"' > /dev/null 2>&1"
+ windows_service_gem_check_command = %q{ruby -r "win32/daemon" -e ":noop"}
if defined?(Bundler)
Bundler.with_clean_env do
# This returns true if the gem can be loaded
- system windows_service_gem_check_command
+ system(windows_service_gem_check_command)
end
else
# This returns true if the gem can be loaded
- system windows_service_gem_check_command
+ system(windows_service_gem_check_command)
end
end