Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / is_mac_address_spec.rb
old mode 100755 (executable)
new mode 100644 (file)
index a2c892f..8e96abf
@@ -1,34 +1,46 @@
-#! /usr/bin/env ruby -S rspec
 require 'spec_helper_acceptance'
 
-describe 'is_mac_address function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+describe 'is_mac_address function' do
   describe 'success' do
-    it 'is_mac_addresss a mac' do
-      pp = <<-EOS
+    pp1 = <<-DOC
       $a = '00:a0:1f:12:7f:a0'
       $b = true
       $o = is_mac_address($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_mac_addresss a mac' do
+      apply_manifest(pp1, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{Notice: output correct})
       end
     end
-    it 'is_mac_addresss a mac out of range' do
-      pp = <<-EOS
+
+    pp2 = <<-DOC
       $a = '00:a0:1f:12:7f:g0'
       $b = false
       $o = is_mac_address($a)
       if $o == $b {
         notify { 'output correct': }
       }
-      EOS
+    DOC
+    it 'is_mac_addresss a mac out of range' do
+      apply_manifest(pp2, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{Notice: output correct})
+      end
+    end
 
-      apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/Notice: output correct/)
+    pp3 = <<-DOC
+      $a = '80:00:02:09:fe:80:00:00:00:00:00:00:00:24:65:ff:ff:91:a3:12'
+      $b = true
+      $o = is_mac_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+    DOC
+    it 'is_mac_addresss a 20-octet mac' do
+      apply_manifest(pp3, :catch_failures => true) do |r|
+        expect(r.stdout).to match(%r{Notice: output correct})
       end
     end
   end