chomp_spec.rb 423 B

12345678910111213141516171819
  1. require 'spec_helper_acceptance'
  2. describe 'chomp function' do
  3. describe 'success' do
  4. pp = <<-DOC
  5. $input = "test\n"
  6. if size($input) != 5 {
  7. fail("Size of ${input} is not 5.")
  8. }
  9. $output = chomp($input)
  10. if size($output) != 4 {
  11. fail("Size of ${input} is not 4.")
  12. }
  13. DOC
  14. it 'eats the newline' do
  15. apply_manifest(pp, :catch_failures => true)
  16. end
  17. end
  18. end