1 #! /usr/bin/env ruby -S rspec
4 describe "the validate_apache_log_level function" do
5 let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
8 expect(Puppet::Parser::Functions.function("validate_apache_log_level")).to eq("function_validate_apache_log_level")
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) )
15 it "should raise a ParseError when given garbage" do
16 expect { scope.function_validate_apache_log_level(['garbage']) }.to( raise_error(Puppet::ParseError) )
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
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
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
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
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