Merge branch 'mohammad' of https://github.com/mohammadzainabbas/brew into mohammad

This commit is contained in:
Mohammad Zain Abbas 2022-07-05 14:08:30 +02:00
commit 2223a231cc
2 changed files with 11 additions and 10 deletions

View File

@ -1,9 +1,10 @@
# typed: true
# frozen_string_literal: true
# The {Livecheck} class implements the DSL methods used in a formula's, cask's or resource's
# `livecheck` block and stores related instance variables. Most of these methods
# also return the related instance variable when no argument is provided.
# The {Livecheck} class implements the DSL methods used in a formula's, cask's
# or resource's `livecheck` block and stores related instance variables. Most
# of these methods also return the related instance variable when no argument
# is provided.
#
# This information is used by the `brew livecheck` command to control its
# behavior. Example `livecheck` blocks can be found in the
@ -11,8 +12,8 @@
class Livecheck
extend Forwardable
# A very brief description of why the formula/cask/resource is skipped (e.g. `No longer
# developed or maintained`).
# A very brief description of why the formula/cask/resource is skipped (e.g.
# `No longer developed or maintained`).
# @return [String, nil]
attr_reader :skip_msg

View File

@ -9,12 +9,12 @@ describe Resource do
let(:livecheck_resource) {
described_class.new do
url "https://brew.sh/test-0.0.1.tgz"
url "https://brew.sh/foo-1.0.tar.gz"
sha256 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
livecheck do
url "https://brew.sh/foo-1.0.tar.gz"
regex(/foo/)
url "https://brew.sh/test/releases"
regex(/foo[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
end
}
@ -71,8 +71,8 @@ describe Resource do
end
specify "when livecheck block is set" do
expect(livecheck_resource.livecheck.url).to eq("https://brew.sh/foo-1.0.tar.gz")
expect(livecheck_resource.livecheck.regex).to eq(/foo/)
expect(livecheck_resource.livecheck.url).to eq("https://brew.sh/test/releases")
expect(livecheck_resource.livecheck.regex).to eq(/foo[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
end