Merge pull request #6218 from xu-cheng/java_requirement
java_requirement: set cask attribute
This commit is contained in:
commit
8529cf6529
@ -30,6 +30,7 @@ class JavaRequirement < Requirement
|
|||||||
def initialize(tags = [])
|
def initialize(tags = [])
|
||||||
@version = tags.shift if /^\d/ =~ tags.first
|
@version = tags.shift if /^\d/ =~ tags.first
|
||||||
super(tags)
|
super(tags)
|
||||||
|
@cask = suggestion.token
|
||||||
end
|
end
|
||||||
|
|
||||||
def message
|
def message
|
||||||
|
|||||||
@ -105,4 +105,25 @@ describe JavaRequirement do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#suggestion" do
|
||||||
|
context "without specific version" do
|
||||||
|
its(:suggestion) { is_expected.to match(/brew cask install adoptopenjdk/) }
|
||||||
|
its(:cask) { is_expected.to eq("adoptopenjdk") }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with version 1.8" do
|
||||||
|
subject { described_class.new(%w[1.8]) }
|
||||||
|
|
||||||
|
its(:suggestion) { is_expected.to match(%r{brew cask install homebrew/cask-versions/adoptopenjdk8}) }
|
||||||
|
its(:cask) { is_expected.to eq("homebrew/cask-versions/adoptopenjdk8") }
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with version 1.8+" do
|
||||||
|
subject { described_class.new(%w[1.8+]) }
|
||||||
|
|
||||||
|
its(:suggestion) { is_expected.to match(/brew cask install adoptopenjdk/) }
|
||||||
|
its(:cask) { is_expected.to eq("adoptopenjdk") }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user