- before :each do
- scope.stubs(:lookupvar).with('interfaces').returns('eth0,lo')
- scope.stubs(:lookupvar).with('ipaddress').returns('10.0.2.15')
- scope.stubs(:lookupvar).with('ipaddress_eth0').returns('10.0.2.15')
- scope.stubs(:lookupvar).with('ipaddress_lo').returns('127.0.0.1')
- end
-
- it 'should have primary address (10.0.2.15)' do
- expect(subject.call(['10.0.2.15'])).to be_truthy
+ let(:facts) do
+ {
+ :interfaces => 'eth0,lo',
+ :ipaddress => '10.0.0.1',
+ :ipaddress_lo => '127.0.0.1',
+ :ipaddress_eth0 => '10.0.0.1',
+ }