Update tests

This commit is contained in:
Connor Mann 2021-08-06 22:34:30 -04:00
parent 363bcbd72a
commit 1581a29b28
No known key found for this signature in database
GPG Key ID: 5886083015754F6F
2 changed files with 6 additions and 3 deletions

View File

@ -223,14 +223,16 @@ describe Homebrew::CLI::NamedArgs do
(HOMEBREW_CELLAR/"foo/1.0").mkpath (HOMEBREW_CELLAR/"foo/1.0").mkpath
(HOMEBREW_CELLAR/"foo/2.0").mkpath (HOMEBREW_CELLAR/"foo/2.0").mkpath
(HOMEBREW_CELLAR/"bar/1.0").mkpath (HOMEBREW_CELLAR/"bar/1.0").mkpath
(HOMEBREW_CELLAR/"baz/HEAD-1").mkpath head1 = (HOMEBREW_CELLAR/"baz/HEAD-1").mkpath
(HOMEBREW_CELLAR/"baz/HEAD-2").mkpath head2 = HOMEBREW_CELLAR/"baz/HEAD-2"
head2.mkpath
(head2/"INSTALL_RECEIPT.json").write (TEST_FIXTURE_DIR/"receipt.json").read
end end
it "resolves the latest kegs with #resolve_latest_keg" do it "resolves the latest kegs with #resolve_latest_keg" do
latest_kegs = described_class.new("foo", "bar", "baz").to_latest_kegs latest_kegs = described_class.new("foo", "bar", "baz").to_latest_kegs
expect(latest_kegs.map(&:name)).to eq ["foo", "bar", "baz"] expect(latest_kegs.map(&:name)).to eq ["foo", "bar", "baz"]
expect(latest_kegs.map { |k| k.version.version.to_s }).to eq ["2.0", "1.0", "HEAD-1"] expect(latest_kegs.map { |k| k.version.version.to_s }).to eq ["2.0", "1.0", "HEAD-2"]
end end
it "when there are no matching kegs returns an empty array" do it "when there are no matching kegs returns an empty array" do

View File

@ -15,6 +15,7 @@
"bin/foo" "bin/foo"
], ],
"time": 1403827774, "time": 1403827774,
"source_modified_time": 1628303333,
"HEAD": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef", "HEAD": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
"alias_path": "/usr/local/Library/Taps/homebrew/homebrew-core/Aliases/test-formula", "alias_path": "/usr/local/Library/Taps/homebrew/homebrew-core/Aliases/test-formula",
"stdlib": "libcxx", "stdlib": "libcxx",