X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fapache%2Fspec%2Funit%2Fpuppet%2Fparser%2Ffunctions%2Fbool2httpd_spec.rb;fp=3rdparty%2Fmodules%2Fapache%2Fspec%2Funit%2Fpuppet%2Fparser%2Ffunctions%2Fbool2httpd_spec.rb;h=0000000000000000000000000000000000000000;hb=6e1426dc77fb4e5d51f07c187c6f2219431dc31e;hp=b0bcbb6220c5e18fcb0ca2e0077303f14ee1ed18;hpb=87423ba664cd5f2bb462ebadd08b1a90d0fe1c8d;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/apache/spec/unit/puppet/parser/functions/bool2httpd_spec.rb b/3rdparty/modules/apache/spec/unit/puppet/parser/functions/bool2httpd_spec.rb deleted file mode 100644 index b0bcbb622..000000000 --- a/3rdparty/modules/apache/spec/unit/puppet/parser/functions/bool2httpd_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -#! /usr/bin/env ruby -S rspec -require 'spec_helper' - -describe "the bool2httpd function" do - let(:scope) { PuppetlabsSpec::PuppetInternals.scope } - - it "should exist" do - expect(Puppet::Parser::Functions.function("bool2httpd")).to eq("function_bool2httpd") - end - - it "should raise a ParseError if there is less than 1 arguments" do - expect { scope.function_bool2httpd([]) }.to( raise_error(Puppet::ParseError)) - end - - it "should convert true to 'On'" do - result = scope.function_bool2httpd([true]) - expect(result).to(eq('On')) - end - - it "should convert true to a string" do - result = scope.function_bool2httpd([true]) - expect(result.class).to(eq(String)) - end - - it "should convert false to 'Off'" do - result = scope.function_bool2httpd([false]) - expect(result).to(eq('Off')) - end - - it "should convert false to a string" do - result = scope.function_bool2httpd([false]) - expect(result.class).to(eq(String)) - end - - it "should accept (and return) any string" do - result = scope.function_bool2httpd(["mail"]) - expect(result).to(eq('mail')) - end - - it "should accept a nil value (and return Off)" do - result = scope.function_bool2httpd([nil]) - expect(result).to(eq('Off')) - end - - it "should accept an undef value (and return 'Off')" do - result = scope.function_bool2httpd([:undef]) - expect(result).to(eq('Off')) - end - - it "should return a default value on non-matches" do - result = scope.function_bool2httpd(['foo']) - expect(result).to(eq('foo')) - end -end