Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / reject_spec.rb
old mode 100755 (executable)
new mode 100644 (file)
index ce4342d..753dd78
@@ -1,36 +1,34 @@
-#! /usr/bin/env ruby -S rspec
 require 'spec_helper_acceptance'
 
 describe 'reject function' do
   describe 'success' do
-    it 'rejects array of values' do
-      pp = <<-EOS
+    pp1 = <<-DOC
       $o = reject(['aaa','bbb','ccc','aaaddd'], 'aaa')
       notice(inline_template('reject is <%= @o.inspect %>'))
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/reject is \["bbb", "ccc"\]/)
+    DOC
+    it 'rejects array of values' do
+      apply_manifest(pp1, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{reject is \["bbb", "ccc"\]})
       end
     end
-    it 'rejects with empty array' do
-      pp = <<-EOS
+
+    pp2 = <<-DOC
       $o = reject([],'aaa')
       notice(inline_template('reject is <%= @o.inspect %>'))
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/reject is \[\]/)
+    DOC
+    it 'rejects with empty array' do
+      apply_manifest(pp2, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{reject is \[\]})
       end
     end
-    it 'rejects array of values with undef' do
-      pp = <<-EOS
+
+    pp3 = <<-DOC
       $o = reject(['aaa','bbb','ccc','aaaddd'], undef)
       notice(inline_template('reject is <%= @o.inspect %>'))
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/reject is \[\]/)
+    DOC
+    it 'rejects array of values with undef' do
+      apply_manifest(pp3, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{reject is \[\]})
       end
     end
   end