1 require 'spec_helper_acceptance'
3 describe 'chop function', :if => Puppet::Util::Package.versioncmp(return_puppet_version, '6.0.0') < 0 do
8 fail("Size of ${input} is not 4.")
10 $output = chop($input)
11 if size($output) != 3 {
12 fail("Size of ${input} is not 3.")
15 it 'eats the last character' do
16 apply_manifest(pp1, :catch_failures => true)
21 if size($input) != 6 {
22 fail("Size of ${input} is not 6.")
24 $output = chop($input)
25 if size($output) != 4 {
26 fail("Size of ${input} is not 4.")
29 it 'eats the last two characters of \r\n' do
30 apply_manifest(pp2, :catch_failures => true)
35 $output = chop($input)
37 it 'does not fail on empty strings' do
38 apply_manifest(pp3, :catch_failures => true)