]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 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
diff --git a/3rdparty/modules/stdlib/spec/acceptance/chomp_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/chomp_spec.rb
new file mode 100755 (executable)
index 0000000..f6c1595
--- /dev/null
@@ -0,0 +1,21 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'chomp function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' 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
+end