]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/stdlib/spec/acceptance/str2bool_spec.rb
upgrade to stdlib 4.6.1
[dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / str2bool_spec.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
3
4 describe 'str2bool function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5   describe 'success' do
6     it 'works with "y"' do
7       pp = <<-EOS
8       $o = str2bool('y')
9       notice(inline_template('str2bool is <%= @o.inspect %>'))
10       EOS
11
12       apply_manifest(pp, :catch_failures => true) do |r|
13         expect(r.stdout).to match(/str2bool is true/)
14       end
15     end
16     it 'works with "Y"'
17     it 'works with "yes"'
18     it 'works with "1"'
19     it 'works with "true"'
20     it 'works with "n"'
21     it 'works with "N"'
22     it 'works with "no"'
23     it 'works with "0"'
24     it 'works with "false"'
25     it 'works with undef'
26   end
27   describe 'failure' do
28     it 'handles no arguments'
29     it 'handles non arrays or strings'
30   end
31 end