]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/stdlib/spec/acceptance/chomp_spec.rb
upgrade to stdlib 4.6.1
[dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / chomp_spec.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
3
4 describe 'chomp function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5   describe 'success' do
6     it 'should eat the newline' do
7       pp = <<-EOS
8       $input = "test\n"
9       if size($input) != 5 {
10         fail("Size of ${input} is not 5.")
11       }
12       $output = chomp($input)
13       if size($output) != 4 {
14         fail("Size of ${input} is not 4.")
15       }
16       EOS
17
18       apply_manifest(pp, :catch_failures => true)
19     end
20   end
21 end