mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-12-16 05:10:36 +00:00
added context to class spec tests to be able to test osfamily RedHat
This commit is contained in:
parent
be1a555591
commit
ae7256a8c2
@ -1,16 +1,7 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::config', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_file('/etc/td-agent/td-agent.conf').with({
|
||||
'ensure' => 'file',
|
||||
@ -28,4 +19,27 @@ describe 'fluentd::config', :type => :class do
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
end
|
||||
|
@ -1,16 +1,8 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::install', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_package('fluentd').with({
|
||||
'ensure' => 'installed',
|
||||
@ -19,4 +11,27 @@ describe 'fluentd::install', :type => :class do
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1,18 +1,29 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::repo', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
context 'when called with no parameters on osfamily Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
it {
|
||||
should contain_class('fluentd::repo::apt')
|
||||
}
|
||||
end
|
||||
|
||||
context 'when called with no parameters on osfamily RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
it {
|
||||
should contain_class('fluentd::repo::yum')
|
||||
}
|
||||
end
|
||||
end
|
||||
|
@ -1,16 +1,7 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::config', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_service('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
@ -21,4 +12,27 @@ describe 'fluentd::config', :type => :class do
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
end
|
||||
|
@ -1,16 +1,7 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_class('fluentd::repo')
|
||||
should contain_class('fluentd::install')
|
||||
@ -18,4 +9,28 @@ describe 'fluentd', :type => :class do
|
||||
should contain_class('fluentd::service')
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1,16 +1,7 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::user', :type => :class do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
describe 'when called with no parameters on Ubuntu' do
|
||||
shared_examples 'when called with no parameters' do
|
||||
it {
|
||||
should contain_user('fluentd').with({
|
||||
'name' => 'td-agent',
|
||||
@ -19,4 +10,27 @@ describe 'fluentd::user', :type => :class do
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
context 'when osfamily is Debian' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
|
||||
context 'when osfamily is RedHat' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
}
|
||||
}
|
||||
|
||||
include_examples 'when called with no parameters'
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user