modules/firewall/spec/unit/facter/iptables_spec.rb in freighthop-0.3.3 vs modules/firewall/spec/unit/facter/iptables_spec.rb in freighthop-0.4.0
- old
+ new
@@ -1,21 +1,23 @@
require 'spec_helper'
describe "Facter::Util::Fact" do
before {
Facter.clear
- Facter.fact(:kernel).stubs(:value).returns("Linux")
- Facter.fact(:kernelrelease).stubs(:value).returns("2.6")
+ allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux')
+ allow(Facter.fact(:kernelrelease)).to receive(:value).and_return('2.6')
}
describe 'iptables_version' do
it {
- Facter::Util::Resolution.stubs(:exec).with('iptables --version').returns('iptables v1.4.7')
+ allow(Facter::Util::Resolution).to receive(:exec).with('iptables --version').
+ and_return('iptables v1.4.7')
Facter.fact(:iptables_version).value.should == '1.4.7'
}
end
describe 'ip6tables_version' do
- before { Facter::Util::Resolution.stubs(:exec).with('ip6tables --version').returns('ip6tables v1.4.7') }
+ before { allow(Facter::Util::Resolution).to receive(:exec).
+ with('ip6tables --version').and_return('ip6tables v1.4.7') }
it { Facter.fact(:ip6tables_version).value.should == '1.4.7' }
end
end