diff options
author | tyler-ball <tyleraball@gmail.com> | 2014-11-06 15:42:44 -0800 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2014-11-06 15:42:44 -0800 |
commit | 31e42d696263e66becd51a527fc4cf2d88a5735f (patch) | |
tree | f8bb9434d609eabc8ff49da383c1442ee6101277 | |
parent | a0de7e895f5971952764588dd5950a2e4460ea05 (diff) | |
download | chef-31e42d696263e66becd51a527fc4cf2d88a5735f.tar.gz |
Updating with @mcquin and @lamont comments
-rw-r--r-- | lib/chef/audit/chef_example_group.rb | 12 | ||||
-rw-r--r-- | lib/chef/audit/runner.rb | 5 | ||||
-rw-r--r-- | lib/chef/dsl/audit.rb | 6 |
3 files changed, 9 insertions, 14 deletions
diff --git a/lib/chef/audit/chef_example_group.rb b/lib/chef/audit/chef_example_group.rb deleted file mode 100644 index acbf865bdd..0000000000 --- a/lib/chef/audit/chef_example_group.rb +++ /dev/null @@ -1,12 +0,0 @@ - -class Chef - class Audit - class ChefExampleGroup - - # Can encompass tests in a `control` block or `describe` block - ::RSpec::Core::ExampleGroup.define_example_group_method :control - ::RSpec::Core::ExampleGroup.define_example_group_method :__controls__ - - end - end -end diff --git a/lib/chef/audit/runner.rb b/lib/chef/audit/runner.rb index 4c1c76ed0a..4a76b7e65b 100644 --- a/lib/chef/audit/runner.rb +++ b/lib/chef/audit/runner.rb @@ -26,6 +26,7 @@ class Chef class Runner attr_reader :run_context + private :run_context def initialize(run_context) @run_context = run_context @@ -63,12 +64,14 @@ class Chef def setup # We're setting the output stream, but that will only be used for error situations # Our formatter forwards events to the Chef event message bus + # TODO so some testing to see if these output to a log file - we probably need + # to register these before any formatters are added. configuration.output_stream = Chef::Config[:log_location] configuration.error_stream = Chef::Config[:log_location] # TODO im pretty sure I only need this because im running locally in rvmsudo configuration.backtrace_exclusion_patterns.push(Regexp.new("/Users".gsub("/", File::SEPARATOR))) configuration.backtrace_exclusion_patterns.push(Regexp.new("(eval)")) - configuration.color = true + configuration.color = Chef::Config[:color] add_formatters disable_should_syntax diff --git a/lib/chef/dsl/audit.rb b/lib/chef/dsl/audit.rb index c281b91621..42a1927efb 100644 --- a/lib/chef/dsl/audit.rb +++ b/lib/chef/dsl/audit.rb @@ -16,12 +16,16 @@ # limitations under the License. # -require 'chef/audit/chef_example_group' +require 'rspec/core' class Chef module DSL module Audit + # Can encompass tests in a `control` block or `describe` block + ::RSpec::Core::ExampleGroup.define_example_group_method :control + ::RSpec::Core::ExampleGroup.define_example_group_method :__controls__ + # Adds the controls group and block (containing controls to execute) to the runner's list of pending examples def controls(*args, &block) raise ::Chef::Exceptions::NoAuditsProvided unless block |