2014-05-07 03:48:59 +02:00
|
|
|
#! /usr/bin/env ruby -S rspec
|
|
|
|
require 'spec_helper_acceptance'
|
|
|
|
|
|
|
|
describe 'ensure_packages function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
|
|
|
describe 'success' do
|
|
|
|
it 'ensure_packages a package' do
|
|
|
|
apply_manifest('package { "zsh": ensure => absent, }')
|
|
|
|
pp = <<-EOS
|
2014-06-20 00:38:23 +02:00
|
|
|
$a = "rake"
|
|
|
|
ensure_packages($a,{'provider' => 'gem'})
|
2014-05-07 03:48:59 +02:00
|
|
|
EOS
|
|
|
|
|
|
|
|
apply_manifest(pp, :expect_changes => true) do |r|
|
2014-06-03 20:53:04 +02:00
|
|
|
expect(r.stdout).to match(/Package\[zsh\]\/ensure: (created|ensure changed 'purged' to 'present')/)
|
2014-05-07 03:48:59 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
it 'ensures a package already declared'
|
|
|
|
it 'takes defaults arguments'
|
|
|
|
end
|
|
|
|
describe 'failure' do
|
|
|
|
it 'handles no arguments'
|
|
|
|
it 'handles non strings'
|
|
|
|
end
|
|
|
|
end
|