diff options
Diffstat (limited to 'spec/functions/swapcase_spec.rb')
-rwxr-xr-x | spec/functions/swapcase_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/functions/swapcase_spec.rb b/spec/functions/swapcase_spec.rb new file mode 100755 index 0000000..808b415 --- /dev/null +++ b/spec/functions/swapcase_spec.rb @@ -0,0 +1,19 @@ +#! /usr/bin/env ruby -S rspec +require 'spec_helper' + +describe "the swapcase function" do + let(:scope) { PuppetlabsSpec::PuppetInternals.scope } + + it "should exist" do + Puppet::Parser::Functions.function("swapcase").should == "function_swapcase" + end + + it "should raise a ParseError if there is less than 1 arguments" do + lambda { scope.function_swapcase([]) }.should( raise_error(Puppet::ParseError)) + end + + it "should swapcase a string" do + result = scope.function_swapcase(["aaBBccDD"]) + result.should(eq('AAbbCCdd')) + end +end |