From afb78e2b253dfe43816e20afa2f4732eb9dc17eb Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Thu, 13 Mar 2014 18:21:38 +0000 Subject: Add some acceptance tests for functions. --- spec/acceptance/abs_spec.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 spec/acceptance/abs_spec.rb (limited to 'spec/acceptance/abs_spec.rb') diff --git a/spec/acceptance/abs_spec.rb b/spec/acceptance/abs_spec.rb new file mode 100644 index 0000000..0921497 --- /dev/null +++ b/spec/acceptance/abs_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper_acceptance' + +describe 'abs function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do + it 'should accept a string' do + pp = <<-EOS + $input = '-34.56' + $output = abs($input) + notify { $output: } + EOS + + apply_manifest(pp, :catch_failures => true) do |r| + expect(r.stdout).to match(/Notice: 34.56/) + end + end + + it 'should accept a float' do + pp = <<-EOS + $input = -34.56 + $output = abs($input) + notify { $output: } + EOS + + apply_manifest(pp, :catch_failures => true) do |r| + expect(r.stdout).to match(/Notice: 34.56/) + end + end +end -- cgit v1.2.3 From f8f147e794ad305bb8f2dbf5e3a612f0659834ba Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 8 Apr 2014 15:04:55 -0700 Subject: Add success/fail groups --- spec/acceptance/abs_spec.rb | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'spec/acceptance/abs_spec.rb') diff --git a/spec/acceptance/abs_spec.rb b/spec/acceptance/abs_spec.rb index 0921497..eeae89b 100644 --- a/spec/acceptance/abs_spec.rb +++ b/spec/acceptance/abs_spec.rb @@ -1,27 +1,29 @@ require 'spec_helper_acceptance' describe 'abs function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do - it 'should accept a string' do - pp = <<-EOS - $input = '-34.56' - $output = abs($input) - notify { $output: } - EOS + describe 'success' do + it 'should accept a string' do + pp = <<-EOS + $input = '-34.56' + $output = abs($input) + notify { $output: } + EOS - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/Notice: 34.56/) + apply_manifest(pp, :catch_failures => true) do |r| + expect(r.stdout).to match(/Notice: 34.56/) + end end - end - it 'should accept a float' do - pp = <<-EOS - $input = -34.56 - $output = abs($input) - notify { $output: } - EOS + it 'should accept a float' do + pp = <<-EOS + $input = -34.56 + $output = abs($input) + notify { $output: } + EOS - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/Notice: 34.56/) + apply_manifest(pp, :catch_failures => true) do |r| + expect(r.stdout).to match(/Notice: 34.56/) + end end end end -- cgit v1.2.3 From 09f892023c726eabaa85a308c2dbffd8e8b71fbd Mon Sep 17 00:00:00 2001 From: Andrea Veri Date: Wed, 7 May 2014 11:49:25 +0200 Subject: Add the missing shebangs and fix the wrong ones for rpmlint to stop complaining loudly --- spec/acceptance/abs_spec.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/acceptance/abs_spec.rb') diff --git a/spec/acceptance/abs_spec.rb b/spec/acceptance/abs_spec.rb index eeae89b..8e05642 100644 --- a/spec/acceptance/abs_spec.rb +++ b/spec/acceptance/abs_spec.rb @@ -1,3 +1,4 @@ +#! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' describe 'abs function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do -- cgit v1.2.3 From c66a2e4f49d6c9ebcbff718f3ec119049fb4c514 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Wed, 7 May 2014 10:09:32 -0700 Subject: Add mode +x to spec .rb files --- spec/acceptance/abs_spec.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 spec/acceptance/abs_spec.rb (limited to 'spec/acceptance/abs_spec.rb') diff --git a/spec/acceptance/abs_spec.rb b/spec/acceptance/abs_spec.rb old mode 100644 new mode 100755 -- cgit v1.2.3 From 51f1d574d92cf686ac79e57e69d8aff31caf2925 Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Tue, 28 Oct 2014 15:27:24 -0700 Subject: Fix testcases for Future Parser and resolve issue with values_at in assuming that it was dealing with a string --- spec/acceptance/abs_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/acceptance/abs_spec.rb') diff --git a/spec/acceptance/abs_spec.rb b/spec/acceptance/abs_spec.rb index 8e05642..6e41e2f 100755 --- a/spec/acceptance/abs_spec.rb +++ b/spec/acceptance/abs_spec.rb @@ -7,7 +7,7 @@ describe 'abs function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operati pp = <<-EOS $input = '-34.56' $output = abs($input) - notify { $output: } + notify { "$output": } EOS apply_manifest(pp, :catch_failures => true) do |r| @@ -19,7 +19,7 @@ describe 'abs function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operati pp = <<-EOS $input = -34.56 $output = abs($input) - notify { $output: } + notify { "$output": } EOS apply_manifest(pp, :catch_failures => true) do |r| -- cgit v1.2.3