]> git.donarmstrong.com Git - dsa-puppet.git/blob - 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
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper'
3
4 describe "the validate_apache_log_level function" do
5   let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
6
7   it "should exist" do
8     expect(Puppet::Parser::Functions.function("validate_apache_log_level")).to eq("function_validate_apache_log_level")
9   end
10
11   it "should raise a ParseError if there is less than 1 arguments" do
12     expect { scope.function_validate_apache_log_level([]) }.to( raise_error(Puppet::ParseError) )
13   end
14
15   it "should raise a ParseError when given garbage" do
16     expect { scope.function_validate_apache_log_level(['garbage']) }.to( raise_error(Puppet::ParseError) )
17   end
18
19   it "should not raise a ParseError when given a plain log level" do
20     expect { scope.function_validate_apache_log_level(['info']) }.to_not raise_error 
21   end
22
23   it "should not raise a ParseError when given a log level and module log level" do
24     expect { scope.function_validate_apache_log_level(['warn ssl:info']) }.to_not raise_error 
25   end
26
27   it "should not raise a ParseError when given a log level and module log level" do
28     expect { scope.function_validate_apache_log_level(['warn mod_ssl.c:info']) }.to_not raise_error 
29   end
30
31   it "should not raise a ParseError when given a log level and module log level" do
32     expect { scope.function_validate_apache_log_level(['warn ssl_module:info']) }.to_not raise_error 
33   end
34
35   it "should not raise a ParseError when given a trace level" do
36     expect { scope.function_validate_apache_log_level(['trace4']) }.to_not raise_error 
37   end
38
39 end