brew/Library/Homebrew/test/os/mac/dependency_collector_spec.rb
Claudia 5be80a78f6
Use Homebrew-controlled domain for Cask dummy URLs
In a number of Cask specs, the value of the `homepage` stanza is currently set
to https://example.com. As of 2018-11-28, the TLS certificate served by
example.com seems to be expired, possibly due to an oversight on ICANN’s side.

While the certificate is certainly going to be renewed soon, it would be
desirable for Homebrew’s test result to be less dependent on ICANN’s actions.
This commit changes the homepages of all test Casks to http://brew.sh, whose
domain and TLS certificate are both controlled by Homebrew.
2018-11-28 20:51:55 +01:00

63 lines
1.9 KiB
Ruby

require "dependency_collector"
describe DependencyCollector do
alias_matcher :need_tar_xz_dependency, :be_tar_needs_xz_dependency
after do
described_class.clear_cache
end
specify "#tar_needs_xz_dependency?" do
allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.9"))
expect(described_class).not_to need_tar_xz_dependency
end
specify "LD64 pre-Leopard dependency" do
allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.4"))
expect(subject.build(:ld64)).to eq(LD64Dependency.new)
end
specify "LD64 Leopard or newer dependency" do
allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.5"))
expect(subject.build(:ld64)).to be nil
end
specify "Resource xz pre-Mavericks dependency" do
allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.8"))
resource = Resource.new
resource.url("https://brew.sh/foo.tar.xz")
expect(subject.add(resource)).to eq(Dependency.new("xz", [:build]))
end
specify "Resource xz Mavericks or newer dependency" do
allow(MacOS).to receive(:version).and_return(MacOS::Version.new("10.9"))
resource = Resource.new
resource.url("https://brew.sh/foo.tar.xz")
expect(subject.add(resource)).to be nil
end
specify "Resource dependency from a '.zip' URL" do
resource = Resource.new
resource.url("https://brew.sh/foo.zip")
expect(subject.add(resource)).to be nil
end
specify "Resource dependency from a '.bz2' URL" do
resource = Resource.new
resource.url("https://brew.sh/foo.tar.bz2")
expect(subject.add(resource)).to be nil
end
specify "Resource dependency from a '.git' URL" do
resource = Resource.new
resource.url("git://brew.sh/foo/bar.git")
expect(subject.add(resource)).to be nil
end
specify "Resource dependency from a Subversion URL" do
resource = Resource.new
resource.url("svn://brew.sh/foo/bar")
expect(subject.add(resource)).to be nil
end
end