Skip to content

Commit

Permalink
Merge pull request #4 from pondohva/package_providers
Browse files Browse the repository at this point in the history
enable gem and pip providers for package auto_spec
  • Loading branch information
raphink committed Sep 9, 2015
2 parents fd83d15 + 04fb6b9 commit 403daee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/puppetx/policy/auto_spec/package.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Puppetx::Policy::AutoSpec.newspec 'Package' do |p|
providers = ['gem', 'pip']
should = (p[:ensure] == 'absent' or p[:ensure] == 'purged') ? 'should_not' : 'should'
" describe package('#{p[:name]}') do\n it { #{should} be_installed }\n end\n"
provider = providers.include? p[:provider] ? ".by('#{p[:provider]}')" : ''
" describe package('#{p[:name]}') do\n it { #{should} be_installed#{provider} }\n end\n"
end

0 comments on commit 403daee

Please sign in to comment.