X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fany2array_spec.rb;h=2f1ae4e0922d2de789f409c4a6d65bdafbc9e493;hb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f;hp=8a13911ea75151a6bd4b34d97c5030171c68e9bb;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/acceptance/any2array_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/any2array_spec.rb old mode 100755 new mode 100644 index 8a13911ea..2f1ae4e09 --- a/3rdparty/modules/stdlib/spec/acceptance/any2array_spec.rb +++ b/3rdparty/modules/stdlib/spec/acceptance/any2array_spec.rb @@ -1,36 +1,32 @@ -#! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' describe 'any2array function' do describe 'success' do - it 'should create an empty array' do - pp = <<-EOS + pp1 = <<-DOC $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: /) + DOC + it 'creates an empty array' do + apply_manifest(pp1, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: Output: }) end end - it 'should leave arrays modified' do - pp = <<-EOS - $input = ['test', 'array'] + pp2 = <<-DOC + $input = ['array', 'test'] $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: (\[|)test(,\s|)array(\]|)/) + DOC + it 'leaves arrays modified' do + apply_manifest(pp2, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: Output: (\[|)array(,\s|)test(\]|)}) end end - it 'should turn a hash into an array' do - pp = <<-EOS + pp3 = <<-DOC $input = {'test' => 'array'} $output = any2array($input) @@ -39,10 +35,10 @@ describe 'any2array function' do 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: (\[|)test(,\s|)array(\]|)/) + DOC + it 'turns a hash into an array' do + apply_manifest(pp3, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: Output: (\[|)test(,\s|)array(\]|)}) end end end