|
1 | 1 | require 'spec_helper_acceptance' |
2 | 2 |
|
3 | 3 | describe 'any2array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do |
4 | | - it 'should create an empty array' do |
5 | | - pp = <<-EOS |
6 | | - $input = '' |
7 | | - $output = any2array($input) |
8 | | - validate_array($output) |
9 | | - notify { "Output: ${output}": } |
10 | | - EOS |
| 4 | + describe 'success' do |
| 5 | + it 'should create an empty array' do |
| 6 | + pp = <<-EOS |
| 7 | + $input = '' |
| 8 | + $output = any2array($input) |
| 9 | + validate_array($output) |
| 10 | + notify { "Output: ${output}": } |
| 11 | + EOS |
11 | 12 |
|
12 | | - apply_manifest(pp, :catch_failures => true) do |r| |
13 | | - expect(r.stdout).to match(/Notice: Output: /) |
| 13 | + apply_manifest(pp, :catch_failures => true) do |r| |
| 14 | + expect(r.stdout).to match(/Notice: Output: /) |
| 15 | + end |
14 | 16 | end |
15 | | - end |
16 | 17 |
|
17 | | - it 'should leave arrays modified' do |
18 | | - pp = <<-EOS |
19 | | - $input = ['test', 'array'] |
20 | | - $output = any2array($input) |
21 | | - validate_array($output) |
22 | | - notify { "Output: ${output}": } |
23 | | - EOS |
| 18 | + it 'should leave arrays modified' do |
| 19 | + pp = <<-EOS |
| 20 | + $input = ['test', 'array'] |
| 21 | + $output = any2array($input) |
| 22 | + validate_array($output) |
| 23 | + notify { "Output: ${output}": } |
| 24 | + EOS |
24 | 25 |
|
25 | | - apply_manifest(pp, :catch_failures => true) do |r| |
26 | | - expect(r.stdout).to match(/Notice: Output: testarray/) |
| 26 | + apply_manifest(pp, :catch_failures => true) do |r| |
| 27 | + expect(r.stdout).to match(/Notice: Output: testarray/) |
| 28 | + end |
27 | 29 | end |
28 | | - end |
29 | 30 |
|
30 | | - it 'should turn a hash into an array' do |
31 | | - pp = <<-EOS |
32 | | - $input = {'test' => 'array'} |
33 | | - $output = any2array($input) |
| 31 | + it 'should turn a hash into an array' do |
| 32 | + pp = <<-EOS |
| 33 | + $input = {'test' => 'array'} |
| 34 | + $output = any2array($input) |
34 | 35 |
|
35 | | - validate_array($output) |
36 | | - # Check each element of the array is a plain string. |
37 | | - validate_string($output[0]) |
38 | | - validate_string($output[1]) |
39 | | - notify { "Output: ${output}": } |
40 | | - EOS |
| 36 | + validate_array($output) |
| 37 | + # Check each element of the array is a plain string. |
| 38 | + validate_string($output[0]) |
| 39 | + validate_string($output[1]) |
| 40 | + notify { "Output: ${output}": } |
| 41 | + EOS |
41 | 42 |
|
42 | | - apply_manifest(pp, :catch_failures => true) do |r| |
43 | | - expect(r.stdout).to match(/Notice: Output: testarray/) |
| 43 | + apply_manifest(pp, :catch_failures => true) do |r| |
| 44 | + expect(r.stdout).to match(/Notice: Output: testarray/) |
| 45 | + end |
44 | 46 | end |
45 | 47 | end |
46 | 48 | end |
0 commit comments