summaryrefslogtreecommitdiff
path: root/spec/defines/rsyslog_snippet_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/defines/rsyslog_snippet_spec.rb')
-rw-r--r--spec/defines/rsyslog_snippet_spec.rb69
1 files changed, 69 insertions, 0 deletions
diff --git a/spec/defines/rsyslog_snippet_spec.rb b/spec/defines/rsyslog_snippet_spec.rb
new file mode 100644
index 0000000..b279cce
--- /dev/null
+++ b/spec/defines/rsyslog_snippet_spec.rb
@@ -0,0 +1,69 @@
+require 'spec_helper'
+
+describe 'rsyslog::snippet', :type => :define do
+ context "osfamily = RedHat" do
+ let :facts do
+ {
+ :osfamily => 'RedHat',
+ }
+ end
+
+ let (:params) {
+ {
+ 'content' => 'Random Content',
+ }
+ }
+
+ context "default usage (osfamily = RedHat)" do
+ let(:title) { 'rsyslog-snippet-basic' }
+
+ it 'should compile' do
+ should contain_file('/etc/rsyslog.d/rsyslog-snippet-basic.conf').with_content("Random Content\n")
+ end
+ end
+ end
+
+ context "osfamily = Debian" do
+ let :facts do
+ {
+ :osfamily => 'Debian',
+ }
+ end
+
+ let (:params) {
+ {
+ 'content' => 'Random Content',
+ }
+ }
+
+ context "default usage (osfamily = Debian)" do
+ let(:title) { 'rsyslog-snippet-basic' }
+
+ it 'should compile' do
+ should contain_file('/etc/rsyslog.d/rsyslog-snippet-basic.conf').with_content("Random Content\n")
+ end
+ end
+ end
+
+ context "osfamily = FreeBSD" do
+ let :facts do
+ {
+ :osfamily => 'freebsd',
+ }
+ end
+
+ let (:params) {
+ {
+ 'content' => 'Random Content',
+ }
+ }
+
+ context "default usage (osfamily = Debian)" do
+ let(:title) { 'rsyslog-snippet-basic' }
+
+ it 'should compile' do
+ should contain_file('/etc/syslog.d/rsyslog-snippet-basic.conf').with_content("Random Content\n")
+ end
+ end
+ end
+end