X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fis_float_spec.rb;h=524f338d0e71846a23606249dfb90d30c46f0643;hb=131e09855e065be940e104d9ab0f18940cc76257;hp=0b38d942378600316dcbf0f7e2fed03a94711a9d;hpb=407d322498f4fde815abf381007fbecfe5c10b2b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/acceptance/is_float_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/is_float_spec.rb old mode 100755 new mode 100644 index 0b38d9423..524f338d0 --- a/3rdparty/modules/stdlib/spec/acceptance/is_float_spec.rb +++ b/3rdparty/modules/stdlib/spec/acceptance/is_float_spec.rb @@ -1,81 +1,79 @@ -#! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' describe 'is_float function' do describe 'success' do - it 'is_floats arrays' do - pp = <<-EOS + pp1 = <<-DOC $a = ['aaa.com','bbb','ccc'] $o = is_float($a) notice(inline_template('is_float is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/is_float is false/) + DOC + it 'is_floats arrays' do + apply_manifest(pp1, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{is_float is false}) end end - it 'is_floats true' do - pp = <<-EOS + + pp2 = <<-DOC $a = true $o = is_float($a) notice(inline_template('is_float is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/is_float is false/) + DOC + it 'is_floats true' do + apply_manifest(pp2, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{is_float is false}) end end - it 'is_floats strings' do - pp = <<-EOS + + pp3 = <<-DOC $a = "3.5" $b = true $o = is_float($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_floats strings' do + apply_manifest(pp3, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end - it 'is_floats floats' do - pp = <<-EOS + + pp4 = <<-DOC $a = 3.5 $b = true $o = is_float($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_floats floats' do + apply_manifest(pp4, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end - it 'is_floats integers' do - pp = <<-EOS + + pp5 = <<-DOC $a = 3 $b = false $o = is_float($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_floats integers' do + apply_manifest(pp5, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{Notice: output correct}) end end - it 'is_floats hashes' do - pp = <<-EOS + + pp6 = <<-DOC $a = {'aaa'=>'www.com'} $o = is_float($a) notice(inline_template('is_float is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/is_float is false/) + DOC + it 'is_floats hashes' do + apply_manifest(pp6, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{is_float is false}) end end end