Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / is_hash_spec.rb
old mode 100755 (executable)
new mode 100644 (file)
index 64f016c..c5f6b2e
@@ -1,59 +1,57 @@
-#! /usr/bin/env ruby -S rspec
 require 'spec_helper_acceptance'
 
 describe 'is_hash function' do
   describe 'success' do
-    it 'is_hashs arrays' do
-      pp = <<-EOS
+    pp1 = <<-DOC
       $a = ['aaa','bbb','ccc']
       $o = is_hash($a)
       notice(inline_template('is_hash is <%= @o.inspect %>'))
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/is_hash is false/)
+    DOC
+    it 'is_hashs arrays' do
+      apply_manifest(pp1, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{is_hash is false})
       end
     end
-    it 'is_hashs empty hashs' do
-      pp = <<-EOS
+
+    pp2 = <<-DOC
       $a = {}
       $b = true
       $o = is_hash($a)
       if $o == $b {
         notify { 'output correct': }
       }
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/Notice: output correct/)
+    DOC
+    it 'is_hashs empty hashs' do
+      apply_manifest(pp2, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{Notice: output correct})
       end
     end
-    it 'is_hashs strings' do
-      pp = <<-EOS
+
+    pp3 = <<-DOC
       $a = "aoeu"
       $b = false
       $o = is_hash($a)
       if $o == $b {
         notify { 'output correct': }
       }
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/Notice: output correct/)
+    DOC
+    it 'is_hashs strings' do
+      apply_manifest(pp3, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{Notice: output correct})
       end
     end
-    it 'is_hashs hashes' do
-      pp = <<-EOS
+
+    pp4 = <<-DOC
       $a = {'aaa'=>'bbb'}
       $b = true
       $o = is_hash($a)
       if $o == $b {
         notify { 'output correct': }
       }
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/Notice: output correct/)
+    DOC
+    it 'is_hashs hashes' do
+      apply_manifest(pp4, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{Notice: output correct})
       end
     end
   end