X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Funit%2Ffacter%2Fapt_reboot_required_spec.rb;h=b15cb4c6076499b68fceb116776de086eb5af6bb;hb=6d0c3f5537345f27675f044a2181dcadce75fafb;hp=356f36b14de41d65a97f665a2ac0163ae97e30ad;hpb=c7013c082891edae1543c6244f1f0719dae98d13;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/unit/facter/apt_reboot_required_spec.rb b/spec/unit/facter/apt_reboot_required_spec.rb index 356f36b..b15cb4c 100644 --- a/spec/unit/facter/apt_reboot_required_spec.rb +++ b/spec/unit/facter/apt_reboot_required_spec.rb @@ -7,18 +7,18 @@ describe 'apt_reboot_required fact' do describe 'if a reboot is required' do before(:each) do - Facter.fact(:osfamily).expects(:value).at_least(1).returns 'Debian' - File.stubs(:file?).returns true - File.expects(:file?).at_least(1).with('/var/run/reboot-required').returns true + allow(Facter.fact(:osfamily)).to receive(:value).and_return('Debian') + allow(File).to receive(:file?).and_return(true) + allow(File).to receive(:file?).once.with('/var/run/reboot-required').and_return(true) end it { is_expected.to eq true } end describe 'if a reboot is not required' do before(:each) do - Facter.fact(:osfamily).expects(:value).at_least(1).returns 'Debian' - File.stubs(:file?).returns true - File.expects(:file?).at_least(1).with('/var/run/reboot-required').returns false + allow(Facter.fact(:osfamily)).to receive(:value).and_return('Debian') + allow(File).to receive(:file?).and_return(true) + allow(File).to receive(:file?).once.with('/var/run/reboot-required').and_return(false) end it { is_expected.to eq false } end