X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fabs_spec.rb;fp=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fabs_spec.rb;h=6e41e2fde191cebe8ca7b1b5a3b1f01aace297d9;hp=0000000000000000000000000000000000000000;hb=ad88f67c13ae0f1a08936dad643f1e3509ab5f40;hpb=23d29143ac40015ce61cf83a4067466f8f7d66dc diff --git a/3rdparty/modules/stdlib/spec/acceptance/abs_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/abs_spec.rb new file mode 100755 index 00000000..6e41e2fd --- /dev/null +++ b/3rdparty/modules/stdlib/spec/acceptance/abs_spec.rb @@ -0,0 +1,30 @@ +#! /usr/bin/env ruby -S rspec +require 'spec_helper_acceptance' + +describe 'abs function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do + describe 'success' do + it 'should accept a string' do + pp = <<-EOS + $input = '-34.56' + $output = abs($input) + notify { "$output": } + EOS + + apply_manifest(pp, :catch_failures => true) do |r| + expect(r.stdout).to match(/Notice: 34.56/) + end + end + + it 'should accept a float' do + pp = <<-EOS + $input = -34.56 + $output = abs($input) + notify { "$output": } + EOS + + apply_manifest(pp, :catch_failures => true) do |r| + expect(r.stdout).to match(/Notice: 34.56/) + end + end + end +end