summaryrefslogtreecommitdiff
path: root/kitchen-tests/cookbooks/audit_test/recipes/serverspec_support.rb
blob: 0396cc0de7d1ac2bb8b734e83306b35ff5e71358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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