1 require 'spec_helper_acceptance'
3 codename = fact('lsbdistcodename')
5 describe 'apt::force define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
7 it 'should work with no errors' do
10 apt::force { 'vim': release => false, }
13 shell('apt-get remove -y vim')
14 apply_manifest(pp, :catch_failures => true)
17 describe package('vim') do
18 it { should be_installed }
23 it 'should work with no errors' do
26 apt::force { 'vim': release => '#{codename}' }
29 shell('apt-get remove -y vim')
30 apply_manifest(pp, :catch_failures => true) do |r|
31 expect(r.stdout).to match(/apt-get -y -t #{codename} install vim/)
35 describe package('vim') do
36 it { should be_installed }
41 it 'should work with no errors' do
44 apt::force { 'vim': version => '1.1.1', release => false, }
47 shell('apt-get remove -y vim')
48 apply_manifest(pp, :catch_failures => false) do |r|
49 expect(r.stdout).to match(/apt-get -y install vim=1.1.1/)
53 describe package('vim') do
54 it { should_not be_installed }
59 it 'should work with no errors' do
62 apt::force { 'vim': release => false, timeout => '1' }
65 shell('apt-get clean')
66 apply_manifest(pp, :expect_failures => true) do |r|
67 expect(r.stderr).to match(/Error: Command exceeded timeout/)
71 describe package('vim') do
72 it { should_not be_installed }