|
9 | 9 | let(:expected_root_home) { '/' }
|
10 | 10 |
|
11 | 11 | it 'returns /' do
|
12 |
| - expect(Facter::Util::Resolution).to receive(:exec).with('getent passwd root').and_return(root_ent) |
| 12 | + expect(Facter::Core::Execution).to receive(:execute).with('getent passwd root').and_return(root_ent) |
13 | 13 | expect(described_class.returnt_root_home).to eq(expected_root_home)
|
14 | 14 | end
|
15 | 15 | end
|
|
18 | 18 | let(:expected_root_home) { '/root' }
|
19 | 19 |
|
20 | 20 | it 'returns /root' do
|
21 |
| - expect(Facter::Util::Resolution).to receive(:exec).with('getent passwd root').and_return(root_ent) |
| 21 | + expect(Facter::Core::Execution).to receive(:execute).with('getent passwd root').and_return(root_ent) |
22 | 22 | expect(described_class.returnt_root_home).to eq(expected_root_home)
|
23 | 23 | end
|
24 | 24 | end
|
25 | 25 | context 'when windows' do
|
26 | 26 | it 'is nil on windows' do
|
27 |
| - expect(Facter::Util::Resolution).to receive(:exec).with('getent passwd root').and_return(nil) |
| 27 | + expect(Facter::Core::Execution).to receive(:execute).with('getent passwd root').and_return(nil) |
28 | 28 | expect(described_class.returnt_root_home).to be_nil
|
29 | 29 | end
|
30 | 30 | end
|
|
44 | 44 | sample_dscacheutil = File.read(fixtures('dscacheutil', 'root'))
|
45 | 45 |
|
46 | 46 | it 'returns /var/root' do
|
47 |
| - allow(Facter::Util::Resolution).to receive(:exec).with('dscacheutil -q user -a name root').and_return(sample_dscacheutil) |
| 47 | + allow(Facter::Core::Execution).to receive(:execute).with('dscacheutil -q user -a name root').and_return(sample_dscacheutil) |
48 | 48 | expect(Facter.fact(:root_home).value).to eq(expected_root_home)
|
49 | 49 | end
|
50 | 50 | end
|
|
59 | 59 | sample_lsuser = File.read(fixtures('lsuser', 'root'))
|
60 | 60 |
|
61 | 61 | it 'returns /root' do
|
62 |
| - allow(Facter::Util::Resolution).to receive(:exec).with('lsuser -c -a home root').and_return(sample_lsuser) |
| 62 | + allow(Facter::Core::Execution).to receive(:execute).with('lsuser -c -a home root').and_return(sample_lsuser) |
63 | 63 | expect(Facter.fact(:root_home).value).to eq(expected_root_home)
|
64 | 64 | end
|
65 | 65 | end
|
|
0 commit comments