summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-11-21 10:10:56 -0800
committerSerdar Sutay <serdar@opscode.com>2014-11-21 14:58:03 -0800
commit337febc9511027aff0d819d8173504efcb4d29c9 (patch)
tree5c0f9265a293ae65f8f5962dcd501bd04f2740c5
parent5785b62c35c961d811c0b5e43f9fffbfcadb3bc7 (diff)
downloadchef-337febc9511027aff0d819d8173504efcb4d29c9.tar.gz
Test including supported serverspec helpers. Updates per PR comments.
-rw-r--r--kitchen-tests/cookbooks/audit_test/recipes/serverspec_support.rb37
-rw-r--r--kitchen-tests/cookbooks/webapp/README.md4
-rw-r--r--lib/chef/formatters/doc.rb6
3 files changed, 42 insertions, 5 deletions
diff --git a/kitchen-tests/cookbooks/audit_test/recipes/serverspec_support.rb b/kitchen-tests/cookbooks/audit_test/recipes/serverspec_support.rb
new file mode 100644
index 0000000000..0396cc0de7
--- /dev/null
+++ b/kitchen-tests/cookbooks/audit_test/recipes/serverspec_support.rb
@@ -0,0 +1,37 @@
+#
+# Cookbook Name:: audit_test
+# Recipe:: serverspec_support
+#
+# Copyright (c) 2014 The Authors, All Rights Reserved.
+
+file "/tmp/audit_test_file" do
+ action :create
+ content "Welcome to audit mode."
+end
+
+# package "curl" do
+# action :install
+# end
+
+controls "serverspec helpers with types" do
+ control "file helper" do
+ it "says welcome" do
+ expect(file("/tmp/audit_test_file")).to contain("Welcome")
+ end
+ end
+
+ control service("com.apple.CoreRAID") do
+ it { is_expected.to be_enabled }
+ it { is_expected.not_to be_running }
+ end
+
+ # describe "package helper" do
+ # it "works" do
+ # expect(package("curl")).to be_installed
+ # end
+ # end
+
+ control package("postgresql") do
+ it { is_expected.to_not be_installed }
+ end
+end
diff --git a/kitchen-tests/cookbooks/webapp/README.md b/kitchen-tests/cookbooks/webapp/README.md
index 5c55542cbf..00619d490d 100644
--- a/kitchen-tests/cookbooks/webapp/README.md
+++ b/kitchen-tests/cookbooks/webapp/README.md
@@ -6,5 +6,7 @@ In order to run these tests on your dev box:
```
$ bundle install
-$ bundle exec chef-client -c kitchen-tests/.chef/client.rb -z -o audit_test::default
+$ bundle exec chef-client -c kitchen-tests/.chef/client.rb -z -o audit_test::default -l debug
```
+
+Expected JSON output for the tests will be printed to `debug` log.
diff --git a/lib/chef/formatters/doc.rb b/lib/chef/formatters/doc.rb
index 09d04f3aae..99603965a9 100644
--- a/lib/chef/formatters/doc.rb
+++ b/lib/chef/formatters/doc.rb
@@ -163,13 +163,11 @@ class Chef
# Called before audit phase starts
def audit_phase_start(run_status)
- puts_line ""
- puts_line "++ Audit phase starting ++"
+ puts_line "Starting audit phase"
end
def audit_phase_complete
- puts_line ""
- puts_line "++ Audit phase ended ++ "
+ puts_line "Auditing complete"
end
def audit_phase_failed(error)