Skip to content

Commit

Permalink
added flapjack spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrill Poole committed Dec 10, 2014
1 parent f4e2a56 commit dd672d3
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions spec/classes/sensu_flapjack_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
require 'spec_helper'

describe 'sensu' do
let(:facts) { { :fqdn => 'testhost.domain.com', :osfamily => 'RedHat' } }

context 'flapjack config' do

context 'default settings' do
it { should contain_sensu_flapjack_config('testhost.domain.com').with(
:host => 'localhost',
:port => 6379
)}
end # default settings

context 'be configurable' do
let(:params) { {
:flapjack_redis_host => 'flapjack.domain.com',
:flapjack_redis_port => 1234,
:flapjack_redis_db => 2
} }

it { should contain_sensu_flapjack_config('testhost.domain.com').with(
:host => 'flapjack.domain.com',
:port => 1234,
:db => 2
)}
end # be configurable

context 'with server' do
let(:params) { { :server => true } }
it { should contain_file('/etc/sensu/conf.d/flapjack.json').with_ensure('present') }
end # with server

context 'with api' do
let(:params) { { :api => true } }
it { should contain_file('/etc/sensu/conf.d/flapjack.json').with_ensure('present') }
end # with api

context 'purge configs' do
let(:params) { {
:purge_config => true,
:server => false,
:api => false,
} }

it { should contain_file('/etc/sensu/conf.d/flapjack.json').with_ensure('absent') }
end # purge configs

end #flapjack config

end

0 comments on commit dd672d3

Please sign in to comment.