summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-12-11 13:39:59 -0800
committerClaire McQuin <claire@getchef.com>2014-12-11 13:39:59 -0800
commit808a0c6e81cdec0f910f189b0074ac704387e9a3 (patch)
tree6106aafdd97cabda2648f0dbc3799f4efbf30980
parent2f07352dffd980e821f37a86e0de86271be0968c (diff)
parente7b78812aed1c1958fe1a263f1a448bba203bc3c (diff)
downloadchef-808a0c6e81cdec0f910f189b0074ac704387e9a3.tar.gz
Merge branch 'audit-mode' of github.com:opscode/chef into mcquin/unit-tests
-rw-r--r--chef.gemspec4
-rw-r--r--lib/chef/audit/audit_event_proxy.rb3
-rw-r--r--spec/unit/recipe_spec.rb7
3 files changed, 10 insertions, 4 deletions
diff --git a/chef.gemspec b/chef.gemspec
index eb7528e630..43fb3d16fe 100644
--- a/chef.gemspec
+++ b/chef.gemspec
@@ -37,8 +37,8 @@ Gem::Specification.new do |s|
%w(rspec-core rspec-expectations rspec-mocks).each { |gem| s.add_dependency gem, "~> 3.1" }
s.add_dependency "rspec_junit_formatter", "~> 0.2.0"
- s.add_dependency "serverspec", "~> 2.3"
- s.add_dependency "specinfra", "~> 2.4"
+ s.add_dependency "serverspec", "~> 2.7"
+ s.add_dependency "specinfra", "~> 2.10"
s.add_development_dependency "rack"
diff --git a/lib/chef/audit/audit_event_proxy.rb b/lib/chef/audit/audit_event_proxy.rb
index 36160db9bb..1e40258113 100644
--- a/lib/chef/audit/audit_event_proxy.rb
+++ b/lib/chef/audit/audit_event_proxy.rb
@@ -43,8 +43,7 @@ class Chef
described_class = example.metadata[:described_class]
if described_class
resource_type = described_class.class.name.split(':')[-1]
- # TODO https://github.com/serverspec/serverspec/pull/493
- resource_name = described_class.instance_variable_get(:@name)
+ resource_name = described_class.name
end
# The following code builds up the context - the list of wrapping `describe` or `control` blocks
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 1b7506d965..3dfbf986d9 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -483,4 +483,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