|
20 | 20 | Facter::Util::Resolution.stubs(:exec) |
21 | 21 | Facter::Util::Resolution.expects(:which).with("python").returns(true) |
22 | 22 | Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python2_version_output) |
23 | | - Facter.value(:python_version).should == "2.7.9" |
| 23 | + expect(Facter.value(:python_version)).to eq("2.7.9") |
24 | 24 | end |
25 | 25 | end |
26 | 26 |
|
27 | 27 | context 'returns nil when `python` not present' do |
28 | 28 | it do |
29 | 29 | Facter::Util::Resolution.stubs(:exec) |
30 | 30 | Facter::Util::Resolution.expects(:which).with("python").returns(false) |
31 | | - Facter.value(:python_version).should == nil |
| 31 | + expect(Facter.value(:python_version)).to eq(nil) |
32 | 32 | end |
33 | 33 | end |
34 | 34 |
|
|
40 | 40 | Facter::Util::Resolution.stubs(:exec) |
41 | 41 | Facter::Util::Resolution.expects(:which).with("python").returns(true) |
42 | 42 | Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python2_version_output) |
43 | | - Facter.value(:python2_version).should == '2.7.9' |
| 43 | + expect(Facter.value(:python2_version)).to eq('2.7.9') |
44 | 44 | end |
45 | 45 | end |
46 | 46 |
|
|
51 | 51 | Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python3_version_output) |
52 | 52 | Facter::Util::Resolution.expects(:which).with("python2").returns(true) |
53 | 53 | Facter::Util::Resolution.expects(:exec).with("python2 -V 2>&1").returns(python2_version_output) |
54 | | - Facter.value(:python2_version).should == '2.7.9' |
| 54 | + expect(Facter.value(:python2_version)).to eq('2.7.9') |
55 | 55 | end |
56 | 56 | end |
57 | | - |
| 57 | + |
58 | 58 | context 'returns nil when `python` is Python 3 and `python2` is absent' do |
59 | 59 | it do |
60 | 60 | Facter::Util::Resolution.stubs(:exec) |
61 | 61 | Facter::Util::Resolution.expects(:which).with("python").returns(true) |
62 | 62 | Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python3_version_output) |
63 | 63 | Facter::Util::Resolution.expects(:which).with("python2").returns(false) |
64 | | - Facter.value(:python2_version).should == nil |
| 64 | + expect(Facter.value(:python2_version)).to eq(nil) |
65 | 65 | end |
66 | 66 | end |
67 | | - |
| 67 | + |
68 | 68 | context 'returns nil when `python2` and `python` are absent' do |
69 | 69 | it do |
70 | 70 | Facter::Util::Resolution.stubs(:exec) |
71 | 71 | Facter::Util::Resolution.expects(:which).with("python").returns(false) |
72 | 72 | Facter::Util::Resolution.expects(:which).with("python2").returns(false) |
73 | | - Facter.value(:python2_version).should == nil |
| 73 | + expect(Facter.value(:python2_version)).to eq(nil) |
74 | 74 | end |
75 | 75 | end |
76 | 76 |
|
77 | 77 | end |
78 | | - |
| 78 | + |
79 | 79 | describe "python3_version" do |
80 | 80 | context 'returns Python 3 version when `python3` present' do |
81 | 81 | it do |
82 | 82 | Facter::Util::Resolution.stubs(:exec) |
83 | 83 | Facter::Util::Resolution.expects(:which).with("python3").returns(true) |
84 | 84 | Facter::Util::Resolution.expects(:exec).with("python3 -V 2>&1").returns(python3_version_output) |
85 | | - Facter.value(:python3_version).should == "3.3.0" |
| 85 | + expect(Facter.value(:python3_version)).to eq("3.3.0") |
86 | 86 | end |
87 | 87 | end |
88 | 88 |
|
89 | 89 | context 'returns nil when `python3` not present' do |
90 | 90 | it do |
91 | 91 | Facter::Util::Resolution.stubs(:exec) |
92 | 92 | Facter::Util::Resolution.expects(:which).with("python3").returns(false) |
93 | | - Facter.value(:python3_version).should == nil |
| 93 | + expect(Facter.value(:python3_version)).to eq(nil) |
94 | 94 | end |
95 | 95 | end |
96 | 96 |
|
|
0 commit comments