]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/apache/spec/unit/puppet/parser/functions/validate_apache_log_level.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / apache / spec / unit / puppet / parser / functions / validate_apache_log_level.rb
diff --git a/3rdparty/modules/apache/spec/unit/puppet/parser/functions/validate_apache_log_level.rb b/3rdparty/modules/apache/spec/unit/puppet/parser/functions/validate_apache_log_level.rb
new file mode 100644 (file)
index 0000000..dfef66e
--- /dev/null
@@ -0,0 +1,39 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+
+describe "the validate_apache_log_level function" do
+  let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
+
+  it "should exist" do
+    expect(Puppet::Parser::Functions.function("validate_apache_log_level")).to eq("function_validate_apache_log_level")
+  end
+
+  it "should raise a ParseError if there is less than 1 arguments" do
+    expect { scope.function_validate_apache_log_level([]) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should raise a ParseError when given garbage" do
+    expect { scope.function_validate_apache_log_level(['garbage']) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should not raise a ParseError when given a plain log level" do
+    expect { scope.function_validate_apache_log_level(['info']) }.to_not raise_error 
+  end
+
+  it "should not raise a ParseError when given a log level and module log level" do
+    expect { scope.function_validate_apache_log_level(['warn ssl:info']) }.to_not raise_error 
+  end
+
+  it "should not raise a ParseError when given a log level and module log level" do
+    expect { scope.function_validate_apache_log_level(['warn mod_ssl.c:info']) }.to_not raise_error 
+  end
+
+  it "should not raise a ParseError when given a log level and module log level" do
+    expect { scope.function_validate_apache_log_level(['warn ssl_module:info']) }.to_not raise_error 
+  end
+
+  it "should not raise a ParseError when given a trace level" do
+    expect { scope.function_validate_apache_log_level(['trace4']) }.to_not raise_error 
+  end
+
+end