summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-04-16 21:30:05 -0700
committerTim Smith <tsmith84@gmail.com>2020-04-16 21:30:05 -0700
commitf0c1f7f3cf2bb3ecc607804132c342a27d14dbf0 (patch)
treef2f2017bc9fe8cb94b959a07ce748c4418d833f9 /spec
parent63a0c2c94e5e09cb85e9c3db3c9c8abd57843330 (diff)
downloadchef-f0c1f7f3cf2bb3ecc607804132c342a27d14dbf0.tar.gz
Add specs for available version
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/provider/package/homebrew_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/provider/package/homebrew_spec.rb b/spec/unit/provider/package/homebrew_spec.rb
index c73d27a037..517e048f49 100644
--- a/spec/unit/provider/package/homebrew_spec.rb
+++ b/spec/unit/provider/package/homebrew_spec.rb
@@ -266,6 +266,18 @@ describe Chef::Provider::Package::Homebrew do
end
end
+ describe "#available_version" do
+ it "returns version of package when exact name given" do
+ allow(provider).to receive(:brew_info).and_return(brew_info_data)
+ expect(provider.available_version("openssl@1.1")).to eql("1.1.1f")
+ end
+
+ it "returns version of package when alias is given" do
+ allow(provider).to receive(:brew_info).and_return(brew_info_data)
+ expect(provider.available_version("openssl")).to eql("1.1.1f")
+ end
+ end
+
describe "brew" do
before do
expect(provider).to receive(:find_homebrew_uid).and_return(homebrew_uid)