- before {
- 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
- }
- it { is_expected.to eq true }
+ before(:each) do
+ 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 be true }