Fix up rspec deprecation warnings.

This commit is contained in:
Alex Harvey
2016-04-12 22:51:28 +10:00
parent 1165f3aaa2
commit 4775718a2f
5 changed files with 73 additions and 73 deletions

View File

@@ -14,7 +14,7 @@ describe Facter::Util::Fact do
EOS
Facter::Util::Resolution.expects(:which).with("readlink").returns(true)
Facter::Util::Resolution.expects(:exec).with("readlink -e /usr/bin/java").returns(java_path_output)
Facter.value(:java_default_home).should == "/usr/lib/jvm/java-7-openjdk-amd64"
expect(Facter.value(:java_default_home)).to eql "/usr/lib/jvm/java-7-openjdk-amd64"
end
end
@@ -22,7 +22,7 @@ describe Facter::Util::Fact do
it do
Facter::Util::Resolution.stubs(:exec)
Facter::Util::Resolution.expects(:which).with("readlink").at_least(1).returns(false)
Facter.value(:java_default_home).should be_nil
expect(Facter.value(:java_default_home)).to be_nil
end
end
end

View File

@@ -13,7 +13,7 @@ describe Facter::Util::Fact do
context 'returns libjvm path' do
context 'on Linux' do
it do
Facter.value(:java_libjvm_path).should == "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server"
expect(Facter.value(:java_libjvm_path)).to eql "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server"
end
end
end

View File

@@ -36,7 +36,7 @@ Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
EOS
Facter::Util::Resolution.expects(:exec).with("/usr/libexec/java_home --failfast 2>&1").returns("/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home")
Facter::Util::Resolution.expects(:exec).with("java -Xmx8m -version 2>&1").returns(java_version_output)
Facter.value(:java_version).should == "1.7.0_71"
expect(Facter.value(:java_version)).to eql "1.7.0_71"
end
end
context 'on other systems' do
@@ -74,7 +74,7 @@ Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
let(:facts) { {:operatingsystem => 'Darwin'} }
it do
Facter::Util::Resolution.expects(:exec).at_least(1).with("/usr/libexec/java_home --failfast 2>&1").returns('Unable to find any JVMs matching version "(null)".')
Facter.value(:java_version).should be_nil
expect(Facter.value(:java_version)).to be_nil
end
end
context 'on other systems' do