1 require 'spec_helper_acceptance'
3 describe 'apt::force define' do
5 it 'should work with no errors' do
11 shell('apt-get remove -y vim')
12 apply_manifest(pp, :catch_failures => true)
15 describe package('vim') do
16 it { should be_installed }
21 it 'should work with no errors' do
24 apt::force { 'vim': release => 'precise' }
27 shell('apt-get remove -y vim')
28 apply_manifest(pp, :catch_failures => true) do |r|
29 expect(r.stdout).to match(/apt-get -y -t precise install vim/)
33 describe package('vim') do
34 it { should be_installed }
39 it 'should work with no errors' do
42 apt::force { 'vim': version => '1.1.1' }
45 shell('apt-get remove -y vim')
46 apply_manifest(pp, :catch_failures => false) do |r|
47 expect(r.stdout).to match(/apt-get -y install vim=1.1.1/)
51 describe package('vim') do
52 it { should_not be_installed }
57 it 'should work with no errors' do
60 apt::force { 'tomcat7': timeout => '1' }
63 shell('apt-get clean')
64 apply_manifest(pp, :expect_failures => true) do |r|
65 expect(r.stderr).to match(/Error: Command exceeded timeout/)
69 describe package('vim') do
70 it { should_not be_installed }