Mercurial > repos > other > Puppet
comparison modules/stdlib/spec/acceptance/is_hash_spec.rb @ 37:addb0ea390a1 puppet-3.6
Update Puppet "stdlib" module
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 14 Mar 2015 20:09:45 +0000 |
parents | |
children | c42fb28cff86 |
comparison
equal
deleted
inserted
replaced
36:37675581a273 | 37:addb0ea390a1 |
---|---|
1 #! /usr/bin/env ruby -S rspec | |
2 require 'spec_helper_acceptance' | |
3 | |
4 describe 'is_hash function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do | |
5 describe 'success' do | |
6 it 'is_hashs arrays' do | |
7 pp = <<-EOS | |
8 $a = ['aaa','bbb','ccc'] | |
9 $o = is_hash($a) | |
10 notice(inline_template('is_hash is <%= @o.inspect %>')) | |
11 EOS | |
12 | |
13 apply_manifest(pp, :catch_failures => true) do |r| | |
14 expect(r.stdout).to match(/is_hash is false/) | |
15 end | |
16 end | |
17 it 'is_hashs empty hashs' do | |
18 pp = <<-EOS | |
19 $a = {} | |
20 $b = true | |
21 $o = is_hash($a) | |
22 if $o == $b { | |
23 notify { 'output correct': } | |
24 } | |
25 EOS | |
26 | |
27 apply_manifest(pp, :catch_failures => true) do |r| | |
28 expect(r.stdout).to match(/Notice: output correct/) | |
29 end | |
30 end | |
31 it 'is_hashs strings' do | |
32 pp = <<-EOS | |
33 $a = "aoeu" | |
34 $b = false | |
35 $o = is_hash($a) | |
36 if $o == $b { | |
37 notify { 'output correct': } | |
38 } | |
39 EOS | |
40 | |
41 apply_manifest(pp, :catch_failures => true) do |r| | |
42 expect(r.stdout).to match(/Notice: output correct/) | |
43 end | |
44 end | |
45 it 'is_hashs hashes' do | |
46 pp = <<-EOS | |
47 $a = {'aaa'=>'bbb'} | |
48 $b = true | |
49 $o = is_hash($a) | |
50 if $o == $b { | |
51 notify { 'output correct': } | |
52 } | |
53 EOS | |
54 | |
55 apply_manifest(pp, :catch_failures => true) do |r| | |
56 expect(r.stdout).to match(/Notice: output correct/) | |
57 end | |
58 end | |
59 end | |
60 describe 'failure' do | |
61 it 'handles improper argument counts' | |
62 end | |
63 end |