summaryrefslogtreecommitdiff
path: root/spec/acceptance/any2array_spec.rb
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppetlabs.com>2014-04-08 15:04:55 -0700
committerHunter Haugen <hunter@puppetlabs.com>2014-04-08 15:04:55 -0700
commitf8f147e794ad305bb8f2dbf5e3a612f0659834ba (patch)
tree9b8b2093204c8ce56d7befdef4cef673fbc479b7 /spec/acceptance/any2array_spec.rb
parentfcbc4b59a69c62239d15aa11ce7fccaeb93da9cf (diff)
Add success/fail groups
Diffstat (limited to 'spec/acceptance/any2array_spec.rb')
-rw-r--r--spec/acceptance/any2array_spec.rb66
1 files changed, 34 insertions, 32 deletions
diff --git a/spec/acceptance/any2array_spec.rb b/spec/acceptance/any2array_spec.rb
index 7d452ed..0127303 100644
--- a/spec/acceptance/any2array_spec.rb
+++ b/spec/acceptance/any2array_spec.rb
@@ -1,46 +1,48 @@
require 'spec_helper_acceptance'
describe 'any2array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
- it 'should create an empty array' do
- pp = <<-EOS
- $input = ''
- $output = any2array($input)
- validate_array($output)
- notify { "Output: ${output}": }
- EOS
+ describe 'success' do
+ it 'should create an empty array' do
+ pp = <<-EOS
+ $input = ''
+ $output = any2array($input)
+ validate_array($output)
+ notify { "Output: ${output}": }
+ EOS
- apply_manifest(pp, :catch_failures => true) do |r|
- expect(r.stdout).to match(/Notice: Output: /)
+ apply_manifest(pp, :catch_failures => true) do |r|
+ expect(r.stdout).to match(/Notice: Output: /)
+ end
end
- end
- it 'should leave arrays modified' do
- pp = <<-EOS
- $input = ['test', 'array']
- $output = any2array($input)
- validate_array($output)
- notify { "Output: ${output}": }
- EOS
+ it 'should leave arrays modified' do
+ pp = <<-EOS
+ $input = ['test', 'array']
+ $output = any2array($input)
+ validate_array($output)
+ notify { "Output: ${output}": }
+ EOS
- apply_manifest(pp, :catch_failures => true) do |r|
- expect(r.stdout).to match(/Notice: Output: testarray/)
+ apply_manifest(pp, :catch_failures => true) do |r|
+ expect(r.stdout).to match(/Notice: Output: testarray/)
+ end
end
- end
- it 'should turn a hash into an array' do
- pp = <<-EOS
- $input = {'test' => 'array'}
- $output = any2array($input)
+ it 'should turn a hash into an array' do
+ pp = <<-EOS
+ $input = {'test' => 'array'}
+ $output = any2array($input)
- validate_array($output)
- # Check each element of the array is a plain string.
- validate_string($output[0])
- validate_string($output[1])
- notify { "Output: ${output}": }
- EOS
+ validate_array($output)
+ # Check each element of the array is a plain string.
+ validate_string($output[0])
+ validate_string($output[1])
+ notify { "Output: ${output}": }
+ EOS
- apply_manifest(pp, :catch_failures => true) do |r|
- expect(r.stdout).to match(/Notice: Output: testarray/)
+ apply_manifest(pp, :catch_failures => true) do |r|
+ expect(r.stdout).to match(/Notice: Output: testarray/)
+ end
end
end
end