Skip to content

Commit d06480a

Browse files
committed
SkipConditions: use versioned URLs in test casks
The `Cask::Cask` objects in the `SkipConditions` tests don't interpolate `version` in the `url` strings, so these are technically unversioned URLs as a result and would be skipped as unversioned. This updates the URLs accordingly, so they won't trigger the unversioned skip as a fallback (if the intended test doesn't work as expected). This is something I discovered while writing a test for a cask that shouldn't be skipped.
1 parent ff2b1d6 commit d06480a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Library/Homebrew/test/livecheck/skip_conditions_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
basic: Cask::Cask.new("test") do
8383
version "0.0.1,2"
8484

85-
url "https://brew.sh/test-0.0.1.tgz"
85+
url "https://brew.sh/test-#{version.csv.first}.tgz"
8686
name "Test"
8787
desc "Test cask"
8888
homepage "https://brew.sh"
@@ -96,7 +96,7 @@
9696
version "0.0.1"
9797
sha256 :no_check
9898

99-
url "https://brew.sh/test-0.0.1.tgz"
99+
url "https://brew.sh/test-#{version}.tgz"
100100
name "Test Deprecate"
101101
desc "Deprecated test cask"
102102
homepage "https://brew.sh"
@@ -107,7 +107,7 @@
107107
version "0.0.1"
108108
sha256 :no_check
109109

110-
url "https://brew.sh/test-0.0.1.tgz"
110+
url "https://brew.sh/test-#{version}.tgz"
111111
name "Test Disable"
112112
desc "Disabled test cask"
113113
homepage "https://brew.sh"
@@ -127,7 +127,7 @@
127127
extract_plist: Cask::Cask.new("test_extract_plist_skip") do
128128
version "0.0.1"
129129

130-
url "https://brew.sh/test-0.0.1.tgz"
130+
url "https://brew.sh/test-#{version}.tgz"
131131
name "Test ExtractPlist Skip"
132132
desc "Skipped test cask"
133133
homepage "https://brew.sh"
@@ -157,7 +157,7 @@
157157
skip: Cask::Cask.new("test_skip") do
158158
version "0.0.1"
159159

160-
url "https://brew.sh/test-0.0.1.tgz"
160+
url "https://brew.sh/test-#{version}.tgz"
161161
name "Test Skip"
162162
desc "Skipped test cask"
163163
homepage "https://brew.sh"
@@ -169,7 +169,7 @@
169169
skip_with_message: Cask::Cask.new("test_skip_with_message") do
170170
version "0.0.1"
171171

172-
url "https://brew.sh/test-0.0.1.tgz"
172+
url "https://brew.sh/test-#{version}.tgz"
173173
name "Test Skip"
174174
desc "Skipped test cask"
175175
homepage "https://brew.sh"

0 commit comments

Comments
 (0)