X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fis_numeric_spec.rb;fp=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fis_numeric_spec.rb;h=4ec7f0c649d1040936b34120b39df5da2aa61854;hb=131e09855e065be940e104d9ab0f18940cc76257;hp=7e6538446c300b7f4ee05811367d10bec1bbcbbb;hpb=407d322498f4fde815abf381007fbecfe5c10b2b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/acceptance/is_numeric_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/is_numeric_spec.rb old mode 100755 new mode 100644 index 7e6538446..4ec7f0c64 --- a/3rdparty/modules/stdlib/spec/acceptance/is_numeric_spec.rb +++ b/3rdparty/modules/stdlib/spec/acceptance/is_numeric_spec.rb @@ -1,90 +1,88 @@ -#! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' describe 'is_numeric function' do describe 'success' do - it 'is_numerics arrays' do - pp = <<-EOS + pp1 = <<-DOC $a = ['aaa.com','bbb','ccc'] $b = false $o = is_numeric($a) if $o == $b { notify { 'output correct': } } - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/Notice: output correct/) + DOC + it 'is_numerics arrays' do + apply_manifest(pp1, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end - it 'is_numerics true' do - pp = <<-EOS + + pp2 = <<-DOC $a = true $b = false $o = is_numeric($a) if $o == $b { notify { 'output correct': } } - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/Notice: output correct/) + DOC + it 'is_numerics true' do + apply_manifest(pp2, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end - it 'is_numerics strings' do - pp = <<-EOS + + pp3 = <<-DOC $a = "3" $b = true $o = is_numeric($a) if $o == $b { notify { 'output correct': } } - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/Notice: output correct/) + DOC + it 'is_numerics strings' do + apply_manifest(pp3, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end - it 'is_numerics floats' do - pp = <<-EOS + + pp4 = <<-DOC $a = 3.5 $b = true $o = is_numeric($a) if $o == $b { notify { 'output correct': } } - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/Notice: output correct/) + DOC + it 'is_numerics floats' do + apply_manifest(pp4, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end - it 'is_numerics integers' do - pp = <<-EOS + + pp5 = <<-DOC $a = 3 $b = true $o = is_numeric($a) if $o == $b { notify { 'output correct': } } - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/Notice: output correct/) + DOC + it 'is_numerics integers' do + apply_manifest(pp5, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end - it 'is_numerics hashes' do - pp = <<-EOS + + pp6 = <<-DOC $a = {'aaa'=>'www.com'} $b = false $o = is_numeric($a) if $o == $b { notify { 'output correct': } } - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/Notice: output correct/) + DOC + it 'is_numerics hashes' do + apply_manifest(pp6, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end end