livecheck: modified test

This commit is contained in:
nandahkrishna 2020-08-29 02:18:18 +05:30
parent 2550af57df
commit 062156365b
No known key found for this signature in database
GPG Key ID: 067E5FCD58ADF3AA

View File

@ -13,8 +13,8 @@ describe Homebrew::Livecheck do
head "https://github.com/Homebrew/brew.git" head "https://github.com/Homebrew/brew.git"
livecheck do livecheck do
url "https://github.s3.amazonaws.com/Homebrew/brew/releases/latest" url "https://formulae.brew.sh/api/formula/ruby.json"
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i) regex(/"stable":"(\d+(?:\.\d+)+)"/i)
end end
end end
end end
@ -138,8 +138,10 @@ describe Homebrew::Livecheck do
end end
describe "::preprocess_url" do describe "::preprocess_url" do
let(:url) { "https://github.s3.amazonaws.com/Homebrew/brew/releases/latest" }
it "returns the preprocessed URL for livecheck to use" do it "returns the preprocessed URL for livecheck to use" do
expect(livecheck.preprocess_url(f.livecheck.url)) expect(livecheck.preprocess_url(url))
.to eq("https://github.com/Homebrew/brew/releases/latest") .to eq("https://github.com/Homebrew/brew/releases/latest")
end end
end end