Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RSpec deprecated messages #250

Merged
merged 1 commit into from
Sep 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/defines/pyvenv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
let (:title) { '/opt/env' }

it {
should contain_file( '/opt/env')
should contain_exec( "python_virtualenv_/opt/env").with_command("pyvenv --clear /opt/env")
is_expected.to contain_file( '/opt/env')
is_expected.to contain_exec( "python_virtualenv_/opt/env").with_command("pyvenv --clear /opt/env")
}

describe 'when ensure' do
Expand All @@ -14,7 +14,7 @@
:ensure => 'absent'
}}
it {
should contain_file( '/opt/env').with_ensure('absent').with_purge( true)
is_expected.to contain_file( '/opt/env').with_ensure('absent').with_purge( true)
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/requirements_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}}
it do
expect {
should compile
is_expected.to compile
}.to raise_error(/root user must be used when virtualenv is system/)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/facter/pip_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("pip").returns(true)
Facter::Util::Resolution.expects(:exec).with("pip --version 2>&1").returns(pip_version_output)
Facter.value(:pip_version).should == "6.0.6"
expect(Facter.value(:pip_version)).to eq("6.0.6")
end
end

context 'returns nil when pip not present' do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("pip").returns(false)
Facter.value(:pip_version).should == nil
expect(Facter.value(:pip_version)).to eq(nil)
end
end

Expand Down
22 changes: 11 additions & 11 deletions spec/unit/facter/python_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("python").returns(true)
Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python2_version_output)
Facter.value(:python_version).should == "2.7.9"
expect(Facter.value(:python_version)).to eq("2.7.9")
end
end

context 'returns nil when `python` not present' do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("python").returns(false)
Facter.value(:python_version).should == nil
expect(Facter.value(:python_version)).to eq(nil)
end
end

Expand All @@ -40,7 +40,7 @@
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("python").returns(true)
Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python2_version_output)
Facter.value(:python2_version).should == '2.7.9'
expect(Facter.value(:python2_version)).to eq('2.7.9')
end
end

Expand All @@ -51,46 +51,46 @@
Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python3_version_output)
Facter::Util::Resolution.expects(:which).with("python2").returns(true)
Facter::Util::Resolution.expects(:exec).with("python2 -V 2>&1").returns(python2_version_output)
Facter.value(:python2_version).should == '2.7.9'
expect(Facter.value(:python2_version)).to eq('2.7.9')
end
end

context 'returns nil when `python` is Python 3 and `python2` is absent' do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("python").returns(true)
Facter::Util::Resolution.expects(:exec).with("python -V 2>&1").returns(python3_version_output)
Facter::Util::Resolution.expects(:which).with("python2").returns(false)
Facter.value(:python2_version).should == nil
expect(Facter.value(:python2_version)).to eq(nil)
end
end

context 'returns nil when `python2` and `python` are absent' do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("python").returns(false)
Facter::Util::Resolution.expects(:which).with("python2").returns(false)
Facter.value(:python2_version).should == nil
expect(Facter.value(:python2_version)).to eq(nil)
end
end

end

describe "python3_version" do
context 'returns Python 3 version when `python3` present' do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("python3").returns(true)
Facter::Util::Resolution.expects(:exec).with("python3 -V 2>&1").returns(python3_version_output)
Facter.value(:python3_version).should == "3.3.0"
expect(Facter.value(:python3_version)).to eq("3.3.0")
end
end

context 'returns nil when `python3` not present' do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("python3").returns(false)
Facter.value(:python3_version).should == nil
expect(Facter.value(:python3_version)).to eq(nil)
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/facter/virtualenv_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("virtualenv").returns(true)
Facter::Util::Resolution.expects(:exec).with("virtualenv --version 2>&1").returns(virtualenv_version_output)
Facter.value(:virtualenv_version).should == "12.0.7"
expect(Facter.value(:virtualenv_version)).to eq("12.0.7")
end
end

context 'returns nil when virtualenv not present' do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("virtualenv").returns(false)
Facter.value(:virtualenv_version).should == nil
expect(Facter.value(:virtualenv_version)).to eq(nil)
end
end

Expand Down