summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chef.gemspec3
-rw-r--r--lib/chef/audit.rb8
-rw-r--r--lib/chef/audit/runner.rb7
3 files changed, 17 insertions, 1 deletions
diff --git a/chef.gemspec b/chef.gemspec
index 0461872668..2138f36114 100644
--- a/chef.gemspec
+++ b/chef.gemspec
@@ -45,6 +45,9 @@ Gem::Specification.new do |s|
%w(rspec-core rspec-expectations rspec-mocks).each { |gem| s.add_development_dependency gem, "~> 3.1" }
+ s.add_development_dependency "serverspec", "~> 2.3"
+ s.add_development_dependency "specinfra", "~> 2.4"
+
s.bindir = "bin"
s.executables = %w( chef-client chef-solo knife chef-shell chef-apply )
diff --git a/lib/chef/audit.rb b/lib/chef/audit.rb
index 43d5c11ee8..0c79928974 100644
--- a/lib/chef/audit.rb
+++ b/lib/chef/audit.rb
@@ -16,7 +16,13 @@
# limitations under the License.
#
-require 'rspec/core'
+require 'rspec'
+
+require 'serverspec/matcher'
+require 'serverspec/helper'
+require 'serverspec/subject'
+
+require 'specinfra'
require 'chef/dsl/audit'
require 'chef/audit/chef_json_formatter'
diff --git a/lib/chef/audit/runner.rb b/lib/chef/audit/runner.rb
index e3699266b8..0f439a1aa5 100644
--- a/lib/chef/audit/runner.rb
+++ b/lib/chef/audit/runner.rb
@@ -62,6 +62,7 @@ class Chef
add_formatters
disable_should_syntax
+ configure_specinfra
end
def add_formatters
@@ -82,6 +83,12 @@ class Chef
end
end
+ def configure_specinfra
+ # TODO: We may need to change this based on operating system (there is a
+ # powershell backend) or roll our own.
+ Specinfra.configuration.backend = :exec
+ end
+
# Register each controls group with the world, which will handle
# the ordering of the audits that will be run.
def register_controls_groups