-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from RoboticCheese/jdh-assorted-updates
Add a remove test suite
- Loading branch information
Showing
11 changed files
with
107 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Encoding: UTF-8 | ||
|
||
name 'chef-dk_test' | ||
maintainer 'Jonathan Hartman' | ||
maintainer_email 'j@p4nt5.com' | ||
license 'apache2' | ||
description 'chef-dk_test' | ||
long_description 'chef-dk_test' | ||
version '0.0.1' | ||
|
||
depends 'chef-dk' | ||
|
||
supports 'ubuntu' | ||
supports 'debian' | ||
supports 'redhat' | ||
supports 'centos' | ||
supports 'scientific' | ||
supports 'amazon' | ||
supports 'fedora' | ||
supports 'mac_os_x' | ||
supports 'windows' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Encoding: UTF-8 | ||
|
||
include_recipe 'chef-dk' | ||
|
||
chef_dk 'default' do | ||
action :remove | ||
end |
22 changes: 22 additions & 0 deletions
22
test/integration/remove/serverspec/localhost/environment_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Encoding: UTF-8 | ||
|
||
require_relative '../spec_helper' | ||
|
||
describe 'chef-dk::remove::environment' do | ||
shared_examples_for 'file without chef shell-init' do | ||
it 'does not contain the chef shell-init command' do | ||
matcher = /^eval "\$\(chef shell-init bash\)"$/ | ||
expect(subject.content).to_not match(matcher) | ||
end | ||
end | ||
|
||
describe file('/etc/bashrc'), | ||
if: %w(darwin redhat fedora).include?(os[:family]) do | ||
it_behaves_like 'file without chef shell-init' | ||
end | ||
|
||
describe file('/etc/bash.bashrc'), | ||
if: %w(ubuntu debian).include?(os[:family]) do | ||
it_behaves_like 'file without chef shell-init' | ||
end | ||
end |
25 changes: 25 additions & 0 deletions
25
test/integration/remove/serverspec/localhost/package_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Encoding: UTF-8 | ||
|
||
require_relative '../spec_helper' | ||
|
||
describe 'chef-dk::remove::package' do | ||
describe package('com.getchef.pkg.chefdk'), if: os[:family] == 'darwin' do | ||
it 'is not installed' do | ||
expect(subject).to_not be_installed.by(:pkgutil) | ||
end | ||
end | ||
|
||
# On Windows, the package name changes to reflect each ChefDK version | ||
describe package('Chef Development Kit v*'), if: os[:family] == 'windows' do | ||
it 'is not installed' do | ||
expect(subject).to_not be_installed | ||
end | ||
end | ||
|
||
describe package('chefdk'), | ||
if: %w(ubuntu debian redhat fedora).include?(os[:family]) do | ||
it 'is not installed' do | ||
expect(subject).to_not be_installed | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Encoding: UTF-8 | ||
|
||
require 'serverspec' | ||
|
||
if RUBY_PLATFORM =~ /mswin|mingw32|windows/ | ||
set :os, family: 'windows' | ||
set :backend, :cmd | ||
else | ||
set :backend, :exec | ||
end |