Merge pull request #16680 from reitermarkus/loader-infinite-recursion
Fix flaky `Formulary` test.
This commit is contained in:
commit
a6d539cf11
@ -85,6 +85,7 @@ describe Cask::CaskLoader, :cask do
|
|||||||
before do
|
before do
|
||||||
(old_tap.path/"tap_migrations.json").write tap_migrations.to_json
|
(old_tap.path/"tap_migrations.json").write tap_migrations.to_json
|
||||||
old_tap.clear_cache
|
old_tap.clear_cache
|
||||||
|
default_tap.clear_cache
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not warn when loading the short token" do
|
it "does not warn when loading the short token" do
|
||||||
@ -104,6 +105,22 @@ describe Cask::CaskLoader, :cask do
|
|||||||
described_class.for("#{old_tap}/#{token}")
|
described_class.for("#{old_tap}/#{token}")
|
||||||
end.to output(%r{Cask #{old_tap}/#{token} was renamed to #{token}\.}).to_stderr
|
end.to output(%r{Cask #{old_tap}/#{token} was renamed to #{token}\.}).to_stderr
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# FIXME
|
||||||
|
# context "when there is an infinite tap migration loop" do
|
||||||
|
# before do
|
||||||
|
# (default_tap.path/"tap_migrations.json").write({
|
||||||
|
# token => old_tap.name,
|
||||||
|
# }.to_json)
|
||||||
|
# default_tap.clear_cache
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# it "stops recursing" do
|
||||||
|
# expect do
|
||||||
|
# described_class.for("#{default_tap}/#{token}")
|
||||||
|
# end.not_to output.to_stderr
|
||||||
|
# end
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -540,7 +540,7 @@ describe Formulary do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "when a formula is migrated to the default tap" do
|
context "when a formula is migrated to the default tap" do
|
||||||
let(:token) { "local-caffeine" }
|
let(:token) { "foo" }
|
||||||
let(:tap_migrations) do
|
let(:tap_migrations) do
|
||||||
{
|
{
|
||||||
token => default_tap.name,
|
token => default_tap.name,
|
||||||
@ -553,6 +553,7 @@ describe Formulary do
|
|||||||
old_tap.path.mkpath
|
old_tap.path.mkpath
|
||||||
(old_tap.path/"tap_migrations.json").write tap_migrations.to_json
|
(old_tap.path/"tap_migrations.json").write tap_migrations.to_json
|
||||||
old_tap.clear_cache
|
old_tap.clear_cache
|
||||||
|
default_tap.clear_cache
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not warn when loading the short token" do
|
it "does not warn when loading the short token" do
|
||||||
@ -572,6 +573,22 @@ describe Formulary do
|
|||||||
described_class.loader_for("#{old_tap}/#{token}")
|
described_class.loader_for("#{old_tap}/#{token}")
|
||||||
end.to output(%r{Formula #{old_tap}/#{token} was renamed to #{token}\.}).to_stderr
|
end.to output(%r{Formula #{old_tap}/#{token} was renamed to #{token}\.}).to_stderr
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# FIXME
|
||||||
|
# context "when there is an infinite tap migration loop" do
|
||||||
|
# before do
|
||||||
|
# (default_tap.path/"tap_migrations.json").write({
|
||||||
|
# token => old_tap.name,
|
||||||
|
# }.to_json)
|
||||||
|
# default_tap.clear_cache
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# it "stops recursing" do
|
||||||
|
# expect do
|
||||||
|
# described_class.loader_for("#{default_tap}/#{token}")
|
||||||
|
# end.not_to output.to_stderr
|
||||||
|
# end
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user