Skip to content

Commit

Permalink
change tests for auditing OSDN download urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron-212 committed May 26, 2024
1 parent 73ead3e commit 0778379
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions Library/Homebrew/test/cask/audit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -932,17 +932,21 @@ def tmp_cask(name, text)

it { is_expected.not_to error_with(message) }
end
end

context "with incorrect OSDN URL format" do
let(:cask_token) { "osdn-incorrect-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" }

it { is_expected.to error_with(message) }
context "when --strict is not passed" do
it { is_expected.not_to error_with(message) }
end

context "with correct OSDN URL format" do
let(:cask_token) { "osdn-correct-url-format" }
context "when --strict is passed" do
let(:strict) { true }

it { is_expected.not_to error_with(message) }
it { is_expected.to error_with(message)}
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 0778379

Please sign in to comment.