diff options
author | tyler-ball <tyleraball@gmail.com> | 2014-12-05 13:42:32 -0800 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2014-12-16 09:58:27 -0800 |
commit | d40763dbe898442dd7ce29181ed65fde5ea49961 (patch) | |
tree | 8c411354d405e8ef913bb0820e15dbfd38ad6993 | |
parent | 6276da1f909aa67af8ad92d3f516c3c71f1e75b3 (diff) | |
download | chef-d40763dbe898442dd7ce29181ed65fde5ea49961.tar.gz |
WIP - getting ready for initial review
-rw-r--r-- | spec/functional/audit/runner_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/functional/audit/runner_spec.rb b/spec/functional/audit/runner_spec.rb index 7e5a99d591..cb998d66aa 100644 --- a/spec/functional/audit/runner_spec.rb +++ b/spec/functional/audit/runner_spec.rb @@ -43,4 +43,38 @@ describe Chef::Audit::Runner do end + # When running these, because we are not mocking out any of the formatters we expect to get dual output on the + # command line + describe "#run" do + + before do + expect(run_context).to receive(:events).and_return(events) + end + + it "Correctly runs an empty controls block" do + expect(run_context).to receive(:audits).and_return({}) + runner.run + end + + it "Correctly runs a single successful control" do + should_pass = lambda do + it "should pass" do + expect(2 - 2).to eq(0) + end + end + + expect(run_context).to receive(:audits).and_return({ + "should pass" => {:args => [], :block => should_pass} + }) + + # TODO capture the output and verify it + runner.run + end + + it "Correctly runs a single failing control", :pending do + + end + + end + end |