api/formula: Fix failing specs
- clear the formula API cache - make the API cache directory - fix stubbed return values (thanks Sorbet!)
This commit is contained in:
parent
200fe2a6b7
commit
bfe5e43ff4
@ -126,6 +126,7 @@ class Tap
|
|||||||
@formula_dir = nil
|
@formula_dir = nil
|
||||||
@cask_dir = nil
|
@cask_dir = nil
|
||||||
@command_dir = nil
|
@command_dir = nil
|
||||||
|
@formula_names = nil
|
||||||
@formula_files = nil
|
@formula_files = nil
|
||||||
@cask_files = nil
|
@cask_files = nil
|
||||||
@alias_dir = nil
|
@alias_dir = nil
|
||||||
|
|||||||
@ -31,7 +31,23 @@ RSpec.describe "Internal Tap JSON -- Formula" do
|
|||||||
|
|
||||||
allow(Homebrew::API).to receive(:fetch_json_api_file)
|
allow(Homebrew::API).to receive(:fetch_json_api_file)
|
||||||
.with("internal/v3/homebrew-core.jws.json")
|
.with("internal/v3/homebrew-core.jws.json")
|
||||||
.and_return(JSON.parse(internal_tap_json), false)
|
.and_return([JSON.parse(internal_tap_json), false])
|
||||||
|
|
||||||
|
# `Tap.reverse_tap_migrations_renames` looks for renames in every
|
||||||
|
# tap so `CoreCaskTap.tap_migrations` gets called and tries to
|
||||||
|
# fetch stuff from the API. This just avoids errors.
|
||||||
|
allow(Homebrew::API).to receive(:fetch_json_api_file)
|
||||||
|
.with("cask_tap_migrations.jws.json", anything)
|
||||||
|
.and_return([{}, false])
|
||||||
|
|
||||||
|
# To allow `formula_names.txt` to be written to the cache.
|
||||||
|
(HOMEBREW_CACHE/"api").mkdir
|
||||||
|
|
||||||
|
Homebrew::API::Formula.clear_cache
|
||||||
|
end
|
||||||
|
|
||||||
|
after do
|
||||||
|
Homebrew::API::Formula.clear_cache
|
||||||
end
|
end
|
||||||
|
|
||||||
it "loads tap aliases" do
|
it "loads tap aliases" do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user