Skip to content

Commit

Permalink
Add serverspec for cask testing
Browse files Browse the repository at this point in the history
Also add a chefignore so chefspec doesn't end up copying the VM if kitchen ran :)
  • Loading branch information
jtimberman committed Jan 13, 2015
1 parent 5185961 commit 5624ccd
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
56 changes: 56 additions & 0 deletions chefignore
@@ -0,0 +1,56 @@
# Put files/directories that should be ignored in this file.
# Lines that start with '# ' are comments.

## OS
.DS_Store
Icon?
nohup.out

## EDITORS
\#*
.#*
*~
*.sw[a-z]
*.bak
REVISION
TAGS*
tmtags
*_flymake.*
*_flymake
*.tmproj
.project
.settings
mkmf.log

## COMPILED
a.out
*.o
*.pyc
*.so

## OTHER SCM
*/.bzr/*
*/.hg/*
*/.svn/*

## Don't send rspecs up in cookbook
.watchr
.rspec
spec/*
spec/fixtures/*
features/*

## SCM
.gitignore

# Berkshelf
Berksfile
Berksfile.lock
cookbooks/*

# Vagrant
.vagrant

# test-kitchen
.kitchen
.kitchen*.yml*
3 changes: 3 additions & 0 deletions test/fixtures/cookbooks/test/recipes/default.rb
@@ -1,2 +1,5 @@
# redis is small and installs fast.
package 'redis'

# so is caffeine
homebrew_cask 'caffeine'
6 changes: 6 additions & 0 deletions test/integration/default/serverspec/default_spec.rb
Expand Up @@ -11,4 +11,10 @@
describe command(%Q[chef-apply -l info -e 'Chef::Log.info(Chef::Platform.find(:mac_os_x, nil)[:package])']) do
its(:stdout) { should match('INFO: Chef::Provider::Package::Homebrew') }
end

describe file('/opt/homebrew-cask/Caskroom/caffeine') do
it { should be_directory }
it { should be_mode 755 }
it { should be_owned_by 'vagrant' }
end
end

0 comments on commit 5624ccd

Please sign in to comment.