Skip to content

Commit

Permalink
adding kitchen test coverage to PATH tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
mwrock committed Nov 17, 2015
1 parent 5fff938 commit 86818cb
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .kitchen.yml
Expand Up @@ -13,5 +13,6 @@ suites:
- name: default
run_list:
- recipe[chocolatey::default]
- recipe[chocolatey_test::default]

attributes:
1 change: 1 addition & 0 deletions Berksfile
Expand Up @@ -4,4 +4,5 @@ metadata

group :integration do
cookbook 'chocolatey_specs', path: './spec/cookbooks/chocolatey_specs'
cookbook 'chocolatey_test', path: './test/cookbooks/chocolatey_test'
end
8 changes: 8 additions & 0 deletions test/cookbooks/chocolatey_test/metadata.rb
@@ -0,0 +1,8 @@
name 'chocolatey_test'
maintainer 'Maintainer'
maintainer_email 'Maintainer@example.com'
license 'Apache 2.0'
description 'Used with Test-Kitchen and ServerSpec to test chocolatey'
version '0.1.0'

depends 'chocolatey'
9 changes: 9 additions & 0 deletions test/cookbooks/chocolatey_test/recipes/default.rb
@@ -0,0 +1,9 @@
chocolatey 'git.install' do
options('params' => "'/GitOnlyOnPath'")
end

git File.join(ENV['TEMP'], 'chocolatey-cookbook') do
repository 'https://github.com/chocolatey/chocolatey-cookbook'
revision 'master'
action :sync
end
8 changes: 8 additions & 0 deletions test/integration/default/serverspec/recipes/default_spec.rb
Expand Up @@ -13,6 +13,14 @@
its(:stdout) { should match(/1 packages installed\./) }
end

RSpec.describe command("#{choco_exe} list -l git.install") do
its(:stdout) { should match(/1 packages installed\./) }
end

RSpec.describe file(chocolatey_nupkg) do
it { should exist }
end

RSpec.describe file(File.join(ENV['TEMP'], 'chocolatey-cookbook', 'metadata.rb')) do
it { should exist }
end

0 comments on commit 86818cb

Please sign in to comment.