2012-03-21 06:21:53 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-06-01 13:21:59 +02:00
|
|
|
describe 'has_ip_network' do
|
|
|
|
it { is_expected.not_to eq(nil) }
|
|
|
|
it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
|
|
|
|
it { is_expected.to run.with_params("one", "two").and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
|
2012-03-21 06:21:53 +01:00
|
|
|
|
|
|
|
context "On Linux Systems" do
|
2015-06-01 13:21:59 +02:00
|
|
|
let(:facts) do
|
|
|
|
{
|
|
|
|
:interfaces => 'eth0,lo',
|
|
|
|
:network => :undefined,
|
|
|
|
:network_lo => '127.0.0.0',
|
|
|
|
:network_eth0 => '10.0.0.0',
|
|
|
|
}
|
2012-03-21 06:21:53 +01:00
|
|
|
end
|
|
|
|
|
2015-06-01 13:21:59 +02:00
|
|
|
it { is_expected.to run.with_params('127.0.0.0').and_return(true) }
|
|
|
|
it { is_expected.to run.with_params('10.0.0.0').and_return(true) }
|
|
|
|
it { is_expected.to run.with_params('8.8.8.0').and_return(false) }
|
2012-03-21 06:21:53 +01:00
|
|
|
end
|
|
|
|
end
|