Skip to content

Commit 163e1da

Browse files
author
Simon Tremblay
committed
Fix RSpec deprecation message like using :expect instead of :should using transpec
1 parent 27e31c2 commit 163e1da

5 files changed

Lines changed: 19 additions & 19 deletions

File tree

spec/defines/pyvenv_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
let (:title) { '/opt/env' }
55

66
it {
7-
should contain_file( '/opt/env')
8-
should contain_exec( "python_virtualenv_/opt/env").with_command("pyvenv --clear /opt/env")
7+
is_expected.to contain_file( '/opt/env')
8+
is_expected.to contain_exec( "python_virtualenv_/opt/env").with_command("pyvenv --clear /opt/env")
99
}
1010

1111
describe 'when ensure' do
@@ -14,7 +14,7 @@
1414
:ensure => 'absent'
1515
}}
1616
it {
17-
should contain_file( '/opt/env').with_ensure('absent').with_purge( true)
17+
is_expected.to contain_file( '/opt/env').with_ensure('absent').with_purge( true)
1818
}
1919
end
2020
end

spec/defines/requirements_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}}
3131
it do
3232
expect {
33-
should compile
33+
is_expected.to compile
3434
}.to raise_error(/root user must be used when virtualenv is system/)
3535
end
3636
end

spec/unit/facter/pip_version_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
Facter::Util::Resolution.stubs(:exec)
1717
Facter::Util::Resolution.expects(:which).with("pip").returns(true)
1818
Facter::Util::Resolution.expects(:exec).with("pip --version 2>&1").returns(pip_version_output)
19-
Facter.value(:pip_version).should == "6.0.6"
19+
expect(Facter.value(:pip_version)).to eq("6.0.6")
2020
end
2121
end
2222

2323
context 'returns nil when pip not present' do
2424
it do
2525
Facter::Util::Resolution.stubs(:exec)
2626
Facter::Util::Resolution.expects(:which).with("pip").returns(false)
27-
Facter.value(:pip_version).should == nil
27+
expect(Facter.value(:pip_version)).to eq(nil)
2828
end
2929
end
3030

spec/unit/facter/python_version_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
Facter::Util::Resolution.stubs(:exec)
2121
Facter::Util::Resolution.expects(:which).with("python").returns(true)
2222
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")
2424
end
2525
end
2626

2727
context 'returns nil when `python` not present' do
2828
it do
2929
Facter::Util::Resolution.stubs(:exec)
3030
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)
3232
end
3333
end
3434

@@ -40,7 +40,7 @@
4040
Facter::Util::Resolution.stubs(:exec)
4141
Facter::Util::Resolution.expects(:which).with("python").returns(true)
4242
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')
4444
end
4545
end
4646

@@ -51,46 +51,46 @@
5151
Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python3_version_output)
5252
Facter::Util::Resolution.expects(:which).with("python2").returns(true)
5353
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')
5555
end
5656
end
57-
57+
5858
context 'returns nil when `python` is Python 3 and `python2` is absent' do
5959
it do
6060
Facter::Util::Resolution.stubs(:exec)
6161
Facter::Util::Resolution.expects(:which).with("python").returns(true)
6262
Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python3_version_output)
6363
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)
6565
end
6666
end
67-
67+
6868
context 'returns nil when `python2` and `python` are absent' do
6969
it do
7070
Facter::Util::Resolution.stubs(:exec)
7171
Facter::Util::Resolution.expects(:which).with("python").returns(false)
7272
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)
7474
end
7575
end
7676

7777
end
78-
78+
7979
describe "python3_version" do
8080
context 'returns Python 3 version when `python3` present' do
8181
it do
8282
Facter::Util::Resolution.stubs(:exec)
8383
Facter::Util::Resolution.expects(:which).with("python3").returns(true)
8484
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")
8686
end
8787
end
8888

8989
context 'returns nil when `python3` not present' do
9090
it do
9191
Facter::Util::Resolution.stubs(:exec)
9292
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)
9494
end
9595
end
9696

spec/unit/facter/virtualenv_version_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
Facter::Util::Resolution.stubs(:exec)
1717
Facter::Util::Resolution.expects(:which).with("virtualenv").returns(true)
1818
Facter::Util::Resolution.expects(:exec).with("virtualenv --version 2>&1").returns(virtualenv_version_output)
19-
Facter.value(:virtualenv_version).should == "12.0.7"
19+
expect(Facter.value(:virtualenv_version)).to eq("12.0.7")
2020
end
2121
end
2222

2323
context 'returns nil when virtualenv not present' do
2424
it do
2525
Facter::Util::Resolution.stubs(:exec)
2626
Facter::Util::Resolution.expects(:which).with("virtualenv").returns(false)
27-
Facter.value(:virtualenv_version).should == nil
27+
expect(Facter.value(:virtualenv_version)).to eq(nil)
2828
end
2929
end
3030

0 commit comments

Comments
 (0)