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/chomp_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spec/acceptance/chomp_spec.rb (limited to 'spec/acceptance/chomp_spec.rb') diff --git a/spec/acceptance/chomp_spec.rb b/spec/acceptance/chomp_spec.rb new file mode 100644 index 0000000..052226f --- /dev/null +++ b/spec/acceptance/chomp_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper_acceptance' + +describe 'chomp function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do + it 'should eat the newline' do + pp = <<-EOS + $input = "test\n" + if size($input) != 5 { + fail("Size of ${input} is not 5.") + } + $output = chomp($input) + if size($output) != 4 { + fail("Size of ${input} is not 4.") + } + EOS + + apply_manifest(pp, :catch_failures => true) + end +end -- cgit v1.2.3