mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-12-16 05:10:36 +00:00
use rspec-puppet-facts for fluentd_repo_apt_spec
This commit is contained in:
parent
e8cdc9a9e0
commit
d7f6d91a11
@ -1,23 +1,18 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::repo::apt', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
:architecture => 'amd64',
|
||||
}
|
||||
}
|
||||
on_supported_os.each do |os, facts|
|
||||
context "on #{os}" do
|
||||
let :facts do
|
||||
facts
|
||||
end
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
it {
|
||||
should contain_class('apt')
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'ensure' => 'present',
|
||||
'location' => 'http://packages.treasuredata.com/2/ubuntu/precise',
|
||||
'release' => 'precise',
|
||||
'repos' => 'contrib',
|
||||
'architecture' => 'amd64',
|
||||
'key' => {
|
||||
@ -30,5 +25,57 @@ describe 'fluentd::repo::apt', :type => :class do
|
||||
}
|
||||
})
|
||||
}
|
||||
case facts[:operatingsystem]
|
||||
when 'Ubuntu'
|
||||
case facts[:lsbdistcodename]
|
||||
when 'precise'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/ubuntu/precise',
|
||||
'release' => 'precise'
|
||||
})
|
||||
}
|
||||
when 'trusty'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/ubuntu/trusty',
|
||||
'release' => 'trusty'
|
||||
})
|
||||
}
|
||||
when 'xenial'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/ubuntu/xenial',
|
||||
'release' => 'xenial'
|
||||
})
|
||||
}
|
||||
end
|
||||
when 'Debian'
|
||||
case facts[:lsbdistcodename]
|
||||
when 'jessie'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/debian/jessie',
|
||||
'release' => 'jessie'
|
||||
})
|
||||
}
|
||||
when 'squeeze'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/debian/squeeze',
|
||||
'release' => 'squeeze'
|
||||
})
|
||||
}
|
||||
when 'wheezy'
|
||||
it {
|
||||
should contain_apt__source('treasure-data').with({
|
||||
'location' => 'http://packages.treasuredata.com/2/debian/wheezy',
|
||||
'release' => 'wheezy'
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user