Last change
on this file since 30960 was 30960, checked in by davidb, 7 years ago |
Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster
|
-
Property svn:executable
set to
*
|
File size:
1.5 KB
|
Line | |
---|
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
|
---|
Note:
See
TracBrowser
for help on using the repository browser.