diff options
author | tyler-ball <tyleraball@gmail.com> | 2014-12-09 08:51:59 -0800 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2014-12-17 18:52:23 -0800 |
commit | e208a23c658c323977026c9696b0582d3a0c45ad (patch) | |
tree | 31a882a360ad36a477124ad0afa5a69babbc1203 /spec/unit | |
parent | 1d64d2371e1abe83c3fe726e46e95d924a44e15d (diff) | |
download | chef-e208a23c658c323977026c9696b0582d3a0c45ad.tar.gz |
Adding test for recipe DSL audit additions
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/audit/audit_event_proxy_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/exceptions_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/recipe_spec.rb | 7 |
3 files changed, 10 insertions, 3 deletions
diff --git a/spec/unit/audit/audit_event_proxy_spec.rb b/spec/unit/audit/audit_event_proxy_spec.rb index 1fddde43f1..2c4a0a1b9a 100644 --- a/spec/unit/audit/audit_event_proxy_spec.rb +++ b/spec/unit/audit/audit_event_proxy_spec.rb @@ -204,7 +204,7 @@ describe Chef::Audit::AuditEventProxy do # Metadata fields let(:described_class) { double("Serverspec::Type::Port", - :class => "Serverspec::Type::Port") } + :class => "Serverspec::Type::Port", :name => resource_name) } # Control data fields let(:resource_type) { "Port" } @@ -262,7 +262,7 @@ describe Chef::Audit::AuditEventProxy do # Metadata parts let(:described_class) { double("Serverspec::Type::File", - :class => "Serverspec::Type::File") } + :class => "Serverspec::Type::File", :name => resource_name) } # Example group parts let(:parent_group) { diff --git a/spec/unit/exceptions_spec.rb b/spec/unit/exceptions_spec.rb index 165c11446b..d35ecc8ec8 100644 --- a/spec/unit/exceptions_spec.rb +++ b/spec/unit/exceptions_spec.rb @@ -85,7 +85,7 @@ describe Chef::Exceptions do describe Chef::Exceptions::RunFailedWrappingError do shared_examples "RunFailedWrappingError expectations" do it "should initialize with a default message" do - expect(e.message).to eq("Found #{num_errors} errors, they are stored in the backtrace\n") + expect(e.message).to eq("Found #{num_errors} errors, they are stored in the backtrace") end it "should provide a modified backtrace when requested" do diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb index e1a42362ef..e8c1358ba2 100644 --- a/spec/unit/recipe_spec.rb +++ b/spec/unit/recipe_spec.rb @@ -484,4 +484,11 @@ describe Chef::Recipe do expect(node[:tags]).to eql([]) end end + + describe "included DSL" do + it "should include features from Chef::DSL::Audit" do + expect(recipe.singleton_class.included_modules).to include(Chef::DSL::Audit) + expect(recipe.respond_to?(:controls)).to be true + end + end end |