Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / validate_string_spec.rb
old mode 100755 (executable)
new mode 100644 (file)
index f04608d..d141f59
@@ -1,39 +1,38 @@
-#! /usr/bin/env ruby -S rspec
 require 'spec_helper_acceptance'
 
 describe 'validate_string function' do
   describe 'success' do
-    it 'validates a single argument' do
-      pp = <<-EOS
+    pp1 = <<-DOC
       $one = 'string'
       validate_string($one)
-      EOS
-
-      apply_manifest(pp, :catch_failures => true)
+    DOC
+    it 'validates a single argument' do
+      apply_manifest(pp1, :catch_failures => true)
     end
-    it 'validates an multiple arguments' do
-      pp = <<-EOS
+
+    pp2 = <<-DOC
       $one = 'string'
       $two = 'also string'
       validate_string($one,$two)
-      EOS
-
-      apply_manifest(pp, :catch_failures => true)
+    DOC
+    it 'validates an multiple arguments' do
+      apply_manifest(pp2, :catch_failures => true)
     end
-    it 'validates undef' do
-      pp = <<-EOS
-      validate_string(undef)
-      EOS
 
-      apply_manifest(pp, :catch_failures => true)
+    pp3 = <<-DOC
+      validate_string(undef)
+    DOC
+    it 'validates undef' do
+      apply_manifest(pp3, :catch_failures => true)
     end
-    it 'validates a non-string' do
-      {
-        %{validate_string({ 'a' => 'hash' })} => "Hash",
-        %{validate_string(['array'])}         => "Array",
-        %{validate_string(false)}             => "FalseClass",
-      }.each do |pp,type|
-        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/a #{type}/)
+
+    {
+      %{validate_string({ 'a' => 'hash' })} => 'Hash',
+      %{validate_string(['array'])}         => 'Array',
+      %{validate_string(false)}             => 'FalseClass',
+    }.each do |pp4, type|
+      it "validates a non-string: #{pp4.inspect}" do
+        expect(apply_manifest(pp4, :expect_failures => true).stderr).to match(%r{a #{type}})
       end
     end
   end