change tests for auditing OSDN download urls

This commit is contained in:
Aaron Ruan 2024-05-27 00:34:08 +08:00
parent 73ead3e5f5
commit 0778379501
No known key found for this signature in database
GPG Key ID: EF612DB3936CDD62
2 changed files with 11 additions and 7 deletions

View File

@ -932,18 +932,22 @@ RSpec.describe Cask::Audit, :cask do
it { is_expected.not_to error_with(message) }
end
context "with incorrect OSDN URL format" do
let(:cask_token) { "osdn-incorrect-url-format" }
it { is_expected.to error_with(message) }
end
context "with correct OSDN URL format" do
let(:cask_token) { "osdn-correct-url-format" }
describe "disable OSDN download url" do
let(:only) { ["download_url_is_osdn"] }
let(:message) { /OSDN download urls are disabled./ }
let(:cask_token) { "osdn-urls" }
context "when --strict is not passed" do
it { is_expected.not_to error_with(message) }
end
context "when --strict is passed" do
let(:strict) { true }
it { is_expected.to error_with(message)}
end
end
describe "generic artifact checks" do

View File

@ -1,4 +1,4 @@
cask "osdn-correct-url-format" do
cask "osdn-urls" do
version "1.2.3"
url "https://user.dl.osdn.jp/something/id/Something-1.2.3.dmg"