X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fsize_spec.rb;h=e84e6652315dd679e9794d71d30abc0b1e305f32;hb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f;hp=6390c20dfbeb499c971217e7dc4c4bd2182ef60d;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/acceptance/size_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/size_spec.rb old mode 100755 new mode 100644 index 6390c20df..e84e66523 --- a/3rdparty/modules/stdlib/spec/acceptance/size_spec.rb +++ b/3rdparty/modules/stdlib/spec/acceptance/size_spec.rb @@ -1,50 +1,48 @@ -#! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'size function' do +describe 'size function', :if => Puppet::Util::Package.versioncmp(return_puppet_version, '6.0.0') < 0 do describe 'success' do - it 'single string size' do - pp = <<-EOS + pp1 = <<-DOC $a = 'discombobulate' $o = size($a) notice(inline_template('size is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/size is 14/) + DOC + it 'single string size' do + apply_manifest(pp1, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{size is 14}) end end - it 'with empty string' do - pp = <<-EOS + + pp2 = <<-DOC $a = '' $o = size($a) notice(inline_template('size is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/size is 0/) + DOC + it 'with empty string' do + apply_manifest(pp2, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{size is 0}) end end - it 'with undef' do - pp = <<-EOS + + pp3 = <<-DOC $a = undef $o = size($a) notice(inline_template('size is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/size is 0/) + DOC + it 'with undef' do + apply_manifest(pp3, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{size is 0}) end end - it 'strings in array' do - pp = <<-EOS + + pp4 = <<-DOC $a = ['discombobulate', 'moo'] $o = size($a) notice(inline_template('size is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/size is 2/) + DOC + it 'strings in array' do + apply_manifest(pp4, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{size is 2}) end end end