X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fhas_interface_with_spec.rb;h=d16dc1ddd3ddd0197277a097c3c3a58d65a6f637;hb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f;hp=fd33af5c5b9e6272a1618df34a3195dd22494e60;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/acceptance/has_interface_with_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/has_interface_with_spec.rb old mode 100755 new mode 100644 index fd33af5c5..d16dc1ddd --- a/3rdparty/modules/stdlib/spec/acceptance/has_interface_with_spec.rb +++ b/3rdparty/modules/stdlib/spec/acceptance/has_interface_with_spec.rb @@ -1,32 +1,30 @@ -#! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'has_interface_with function', :unless => ((fact('osfamily') == 'windows') or (fact('osfamily') == 'AIX')) do +describe 'has_interface_with function', :unless => ((fact('osfamily') == 'windows') || (fact('osfamily') == 'AIX')) do describe 'success' do - it 'has_interface_with existing ipaddress' do - pp = <<-EOS + pp1 = <<-DOC $a = $::ipaddress $o = has_interface_with('ipaddress', $a) notice(inline_template('has_interface_with is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/has_interface_with is true/) + DOC + it 'has_interface_with existing ipaddress' do + apply_manifest(pp1, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{has_interface_with is true}) end end - it 'has_interface_with absent ipaddress' do - pp = <<-EOS + + pp2 = <<-DOC $a = '128.0.0.1' $o = has_interface_with('ipaddress', $a) notice(inline_template('has_interface_with is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/has_interface_with is false/) + DOC + it 'has_interface_with absent ipaddress' do + apply_manifest(pp2, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{has_interface_with is false}) end end - it 'has_interface_with existing interface' do - pp = <<-EOS + + pp3 = <<-DOC if $osfamily == 'Solaris' or $osfamily == 'Darwin' { $a = 'lo0' }elsif $osfamily == 'windows' { @@ -40,10 +38,10 @@ describe 'has_interface_with function', :unless => ((fact('osfamily') == 'window } $o = has_interface_with($a) notice(inline_template('has_interface_with is <%= @o.inspect %>')) - EOS - - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stdout).to match(/has_interface_with is true/) + DOC + it 'has_interface_with existing interface' do + apply_manifest(pp3, :catch_failures => true) do |r| + expect(r.stdout).to match(%r{has_interface_with is true}) end end end