diff options
author | Gabriel Nagy <gabriel.nagy@puppet.com> | 2021-03-11 16:50:58 +0200 |
---|---|---|
committer | Gabriel Nagy <gabriel.nagy@puppet.com> | 2021-03-11 16:53:26 +0200 |
commit | 8843e245bab25ed71d993949604253afe929b611 (patch) | |
tree | 3caa87736d1f4c8b0d10e053d7f36e6eafb4b13c /spec/unit/provider/sshkey | |
parent | 1487c207cca7217a909cf1a305431c45c93be64d (diff) | |
download | puppet-sshkeys_core-8843e245bab25ed71d993949604253afe929b611.tar.gz puppet-sshkeys_core-8843e245bab25ed71d993949604253afe929b611.tar.bz2 |
(maint) Switch to rspec-mocks
Diffstat (limited to 'spec/unit/provider/sshkey')
-rw-r--r-- | spec/unit/provider/sshkey/parsed_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/provider/sshkey/parsed_spec.rb b/spec/unit/provider/sshkey/parsed_spec.rb index 6442183..e839cfe 100644 --- a/spec/unit/provider/sshkey/parsed_spec.rb +++ b/spec/unit/provider/sshkey/parsed_spec.rb @@ -42,7 +42,7 @@ describe 'sshkey parsed provider' do ['sample', 'sample_with_blank_lines'].each do |sample_file| let(:fixture) { my_fixture(sample_file) } - before(:each) { subject.stubs(:default_target).returns(fixture) } + before(:each) { allow(subject).to receive(:default_target).and_return(fixture) } it 'parses to records on prefetch' do expect(subject.target_records(fixture)).to be_empty @@ -72,22 +72,22 @@ describe 'sshkey parsed provider' do context 'default ssh_known_hosts target path' do ['9.10', '9.11', '10.10'].each do |version| it 'is `/etc/ssh_known_hosts` when OSX version 10.10 or older`' do - Facter.expects(:value).with(:operatingsystem).returns('Darwin') - Facter.expects(:value).with(:macosx_productversion_major).returns(version) + expect(Facter).to receive(:value).with(:operatingsystem).and_return('Darwin') + expect(Facter).to receive(:value).with(:macosx_productversion_major).and_return(version) expect(subject.default_target).to eq('/etc/ssh_known_hosts') end end ['10.11', '10.13', '11.0', '11.11'].each do |version| it 'is `/etc/ssh/ssh_known_hosts` when OSX version 10.11 or newer`' do - Facter.expects(:value).with(:operatingsystem).returns('Darwin') - Facter.expects(:value).with(:macosx_productversion_major).returns(version) + expect(Facter).to receive(:value).with(:operatingsystem).and_return('Darwin') + expect(Facter).to receive(:value).with(:macosx_productversion_major).and_return(version) expect(subject.default_target).to eq('/etc/ssh/ssh_known_hosts') end end it 'is `/etc/ssh/ssh_known_hosts` on other operating systems' do - Facter.expects(:value).with(:operatingsystem).returns('RedHat') + expect(Facter).to receive(:value).with(:operatingsystem).and_return('RedHat') expect(subject.default_target).to eq('/etc/ssh/ssh_known_hosts') end end |