]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/stdlib/spec/acceptance/downcase_spec.rb
upgrade to stdlib 4.6.1
[dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / downcase_spec.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
3
4 describe 'downcase function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5   describe 'success' do
6     it 'returns the downcase' do
7       pp = <<-EOS
8       $a = 'AOEU'
9       $b = 'aoeu'
10       $o = downcase($a)
11       if $o == $b {
12         notify { 'output correct': }
13       }
14       EOS
15
16       apply_manifest(pp, :catch_failures => true) do |r|
17         expect(r.stdout).to match(/Notice: output correct/)
18       end
19     end
20     it 'doesn\'t affect lowercase words' do
21       pp = <<-EOS
22       $a = 'aoeu aoeu'
23       $b = 'aoeu aoeu'
24       $o = downcase($a)
25       if $o == $b {
26         notify { 'output correct': }
27       }
28       EOS
29
30       apply_manifest(pp, :catch_failures => true) do |r|
31         expect(r.stdout).to match(/Notice: output correct/)
32       end
33     end
34   end
35   describe 'failure' do
36     it 'handles improper argument counts'
37     it 'handles non-strings'
38   end
39 end