diff options
-rw-r--r-- | lib/chef/audit/runner.rb | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/chef/audit/runner.rb b/lib/chef/audit/runner.rb index c0b64df99d..9bcdeb7bf3 100644 --- a/lib/chef/audit/runner.rb +++ b/lib/chef/audit/runner.rb @@ -37,11 +37,8 @@ class Chef private def setup require_deps - set_streams - add_formatters - disable_should_syntax + configure_rspec configure_specinfra - add_example_group_methods end def register_controls @@ -62,6 +59,22 @@ class Chef require 'chef/audit/rspec_formatter' end + def configure_rspec + set_streams + add_formatters + disable_should_syntax + add_example_group_methods + + RSpec.configure do |c| + c.color = Chef::Config[:color] + c.expose_dsl_globally = false + end + end + + def configure_specinfra + Specinfra.configuration.backend = :exec + end + def set_streams RSpec.configuration.output_stream = Chef::Config[:log_location] RSpec.configuration.error_stream = Chef::Config[:log_location] @@ -81,10 +94,6 @@ class Chef end end - def configure_specinfra - Specinfra.configuration.backend = :exec - end - def add_example_group_methods RSpec::Core::ExampleGroup.define_example_group_method :__controls__ RSpec::Core::ExampleGroup.define_example_group_method :control |