source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/cask/uninstall_methods_order_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 16,474 | # typed: false
# frozen_string_literal: true
require "rubocops/rubocop-cask"
RSpec.describe RuboCop::Cop::Cask::UninstallMethodsOrder, :config do
context "with uninstall blocks" do
context "when methods are incorrectly ordered" do
it "detects and corrects ordering offenses in the uninstall block when each ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/cask/no_autobump.rb | Ruby | bsd-2-clause | 47,751 | main | 2,661 | # typed: false
# frozen_string_literal: true
require "rubocops/rubocop-cask"
RSpec.describe RuboCop::Cop::Cask::NoAutobump, :config do
it "reports no offenses if `reason` is acceptable" do
expect_no_offenses <<~CASK
cask 'foo' do
no_autobump! because: "some reason"
end
CASK
end
it "... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/cask/no_overrides_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 6,267 | # typed: false
# frozen_string_literal: true
require "rubocops/rubocop-cask"
RSpec.describe RuboCop::Cop::Cask::NoOverrides, :config do
it "accepts when there are no `on_*` blocks" do
expect_no_offenses <<~CASK
cask 'foo' do
version '1.2.3'
url 'https://brew.sh/foo.pkg'
name 'Foo'... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/cask/array_alphabetization_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 6,059 | # typed: false
# frozen_string_literal: true
require "rubocops/rubocop-cask"
RSpec.describe RuboCop::Cop::Cask::ArrayAlphabetization, :config do
it "reports an offense when a single `zap trash` path is specified in an array" do
expect_offense(<<~CASK)
cask "foo" do
url "https://example.com/foo.zip... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/cask/shared_filelist_glob_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,025 | # typed: false
# frozen_string_literal: true
require "rubocops/rubocop-cask"
RSpec.describe RuboCop::Cop::Cask::SharedFilelistGlob, :config do
it "reports an offense when a zap trash array includes an .sfl2 or .sfl3 file" do
expect_offense(<<~CASK)
cask "foo" do
url "https://example.com/foo.zip"
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/class/test_present.rb | Ruby | bsd-2-clause | 47,751 | main | 692 | # typed: false
# frozen_string_literal: true
require "rubocops/class"
RSpec.describe RuboCop::Cop::FormulaAuditStrict::TestPresent do
subject(:cop) { described_class.new }
it "reports an offense when there is no test block" do
expect_offense(<<~RUBY)
class Foo < Formula
^^^^^^^^^^^^^^^^^^^ A `tes... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/class/test_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,887 | # typed: false
# frozen_string_literal: true
require "rubocops/class"
RSpec.describe RuboCop::Cop::FormulaAudit::Test do
subject(:cop) { described_class.new }
it "reports and corrects an offense when /usr/local/bin is found in test calls" do
expect_offense(<<~'RUBY')
class Foo < Formula
url 'ht... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/class/class_name_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,414 | # typed: false
# frozen_string_literal: true
require "rubocops/class"
RSpec.describe RuboCop::Cop::FormulaAudit::ClassName do
subject(:cop) { described_class.new }
let(:corrected_source) do
<<~RUBY
class Foo < Formula
url 'https://brew.sh/foo-1.0.tgz'
end
RUBY
end
it "reports and... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/livecheck/regex_extension_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,246 | # typed: false
# frozen_string_literal: true
require "rubocops/livecheck"
RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckRegexExtension do
subject(:cop) { described_class.new }
it "reports an offense when the `regex` does not use `\\.t` for archive file extensions" do
expect_offense(<<~RUBY)
class... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,276 | # typed: false
# frozen_string_literal: true
require "rubocops/livecheck"
RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckRegexParentheses do
subject(:cop) { described_class.new }
it "reports an offense when the `regex` call in the `livecheck` block does not use parentheses" do
expect_offense(<<~RUBY)
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/livecheck/skip_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,081 | # typed: false
# frozen_string_literal: true
require "rubocops/livecheck"
RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckSkip do
subject(:cop) { described_class.new }
it "reports an offense when a skipped formula's `livecheck` block contains other information" do
expect_offense(<<~RUBY)
class Foo ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,084 | # typed: false
# frozen_string_literal: true
require "rubocops/livecheck"
RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckUrlSymbol do
subject(:cop) { described_class.new }
it "reports an offense when the `url` specified in the `livecheck` block is identical to a formula URL" do
expect_offense(<<~RUBY)
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,568 | # typed: false
# frozen_string_literal: true
require "rubocops/livecheck"
RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckUrlProvided do
subject(:cop) { described_class.new }
it "reports an offense when a `url` is not specified in a `livecheck` block" do
expect_offense(<<~RUBY)
class Foo < Formula
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/livecheck/regex_if_page_match_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 969 | # typed: false
# frozen_string_literal: true
require "rubocops/livecheck"
RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckRegexIfPageMatch do
subject(:cop) { described_class.new }
it "reports an offense when there is no `regex` for `strategy :page_match`" do
expect_offense(<<~RUBY)
class Foo < Form... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/livecheck/regex_case_insensitive_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,275 | # typed: false
# frozen_string_literal: true
require "rubocops/livecheck"
RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckRegexCaseInsensitive do
subject(:cop) { described_class.new }
it "reports an offense when the `regex` is not case-insensitive" do
expect_offense(<<~RUBY)
class Foo < Formula
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/deprecate_disable/date_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 4,599 | # typed: false
# frozen_string_literal: true
require "rubocops/deprecate_disable"
RSpec.describe RuboCop::Cop::FormulaAudit::DeprecateDisableDate do
subject(:cop) { described_class.new }
context "when auditing `deprecate!`" do
it "reports and corrects an offense if `date` is not ISO 8601 compliant" do
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/deprecate_disable/reason_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 10,617 | # typed: false
# frozen_string_literal: true
require "rubocops/deprecate_disable"
RSpec.describe RuboCop::Cop::FormulaAudit::DeprecateDisableReason do
subject(:cop) { described_class.new }
context "when auditing `deprecate!`" do
it "reports no offenses if `reason` is acceptable" do
expect_no_offenses(<... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/lines/full_dependency_check_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,451 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::FullDependencyCheck do
subject(:cop) { described_class.new }
context "when auditing -full dependencies in homebrew/core" do
it "reports an offense when a formula depends on a -full formula" do
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/lines/class_inheritance_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 612 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::ClassInheritance do
subject(:cop) { described_class.new }
context "when auditing formula class inheritance" do
it "reports an offense when not using spaces for class inheritance" do
expect_o... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/lines/libiconv_check_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,294 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::LibiconvCheck do
subject(:cop) { described_class.new }
context "when auditing libiconv dependencies in homebrew/core" do
it "reports an offense when a formula depends on `libiconv`" do
expec... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/lines/generate_completions_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 6,451 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit do
describe RuboCop::Cop::FormulaAudit::GenerateCompletionsDSL do
subject(:cop) { described_class.new }
it "reports an offense when writing to a shell completions file directly" do
expect_o... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/lines/quictls_check_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 673 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::QuicTLSCheck do
subject(:cop) { described_class.new }
context "when auditing formula dependencies" do
it "reports an offense when a formula depends on `quictls`" do
expect_offense(<<~RUBY, "... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/checksum/checksum_case_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,768 | # typed: false
# frozen_string_literal: true
require "rubocops/checksum"
RSpec.describe RuboCop::Cop::FormulaAudit::ChecksumCase do
subject(:cop) { described_class.new }
context "when auditing spec checksums" do
it "reports an offense if a checksum contains uppercase letters" do
expect_offense(<<~RUBY)... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/checksum/checksum_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,648 | # typed: false
# frozen_string_literal: true
require "rubocops/checksum"
RSpec.describe RuboCop::Cop::FormulaAudit::Checksum do
subject(:cop) { described_class.new }
context "when auditing spec checksums" do
it "reports an offense if a checksum is empty" do
expect_offense(<<~RUBY)
class Foo < F... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/on_system_conditionals_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 15,480 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::OnSystemConditionals do
subject(:cop) { described_class.new }
context "when auditing OS conditionals" do
it "reports an offense when `OS.linux?` is used on Formula class" do
expect_offense(<... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/miscellaneous_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 13,714 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::Miscellaneous do
subject(:cop) { described_class.new }
context "when auditing formula miscellany" do
it "reports an offense for unneeded `FileUtils` usage" do
expect_offense(<<~RUBY)
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/comments_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,914 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::Comments do
subject(:cop) { described_class.new }
context "when auditing comment text" do
it "reports an offense when commented cmake calls exist" do
expect_offense(<<~RUBY)
class Fo... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/strict_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 5,760 | # typed: false
# frozen_string_literal: true
require "rubocops/text"
RSpec.describe RuboCop::Cop::FormulaAuditStrict::Text do
subject(:cop) { described_class.new }
context "when auditing formula text in homebrew/core" do
it "reports an offense if `env :userpaths` is present" do
expect_offense(<<~RUBY)
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/licenses_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,362 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::Licenses do
subject(:cop) { described_class.new }
context "when auditing licenses" do
it "reports no offenses for license strings" do
expect_no_offenses(<<~RUBY)
class Foo < Formula
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/safe_popen_commands_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,521 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::SafePopenCommands do
subject(:cop) { described_class.new }
context "when auditing popen commands" do
it "reports and corrects `Utils.popen_read` usage" do
expect_offense(<<~RUBY)
cla... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/option_declarations_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 5,424 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::OptionDeclarations do
subject(:cop) { described_class.new }
context "when auditing options" do
it "reports an offense when `build.without?` is used in homebrew/core" do
expect_offense(<<~RUB... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/mpi_check_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 847 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::MpiCheck do
subject(:cop) { described_class.new }
context "when auditing MPI dependencies" do
it "reports and corrects an offense when using depends_on \"mpich\" in homebrew/core" do
expect_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/shell_variables_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,730 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::ShellVariables do
subject(:cop) { described_class.new }
context "when auditing shell variables" do
it "reports and corrects unexpanded shell variables in `Utils.popen`" do
expect_offense(<<~... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/macos_on_linux_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,726 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::MacOSOnLinux do
subject(:cop) { described_class.new }
it "reports an offense when `MacOS` is used in the `Formula` class" do
expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb")
class Fo... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/python_versions_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 5,577 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::PythonVersions do
subject(:cop) { described_class.new }
context "when auditing Python versions" do
it "reports no offenses for Python with no dependency" do
expect_no_offenses(<<~RUBY)
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/std_npm_args_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,825 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::StdNpmArgs do
subject(:cop) { described_class.new }
context "when auditing node formulae" do
it "reports an offense when `npm install` is called without std_npm_args arguments" do
expect_off... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/license_arrays_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,531 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::LicenseArrays do
subject(:cop) { described_class.new }
context "when auditing license arrays" do
it "reports no offenses for license strings" do
expect_no_offenses(<<~RUBY)
class Foo... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/make_check_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,253 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAuditStrict::MakeCheck do
subject(:cop) { described_class.new }
let(:path) { HOMEBREW_TAP_DIRECTORY/"homebrew/homebrew-core" }
before do
path.mkpath
(path/"style_exceptions").mkpath
end
def s... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/text/assert_statements_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,979 | # typed: false
# frozen_string_literal: true
require "rubocops/lines"
RSpec.describe RuboCop::Cop::FormulaAudit::AssertStatements do
subject(:cop) { described_class.new }
context "when auditing formula assertions" do
it "reports an offense when assert ... include is used" do
expect_offense(<<~RUBY)
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/bottle/bottle_tag_indentation_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,615 | # typed: false
# frozen_string_literal: true
require "rubocops/bottle"
RSpec.describe RuboCop::Cop::FormulaAudit::BottleTagIndentation do
subject(:cop) { described_class.new }
it "reports no offenses for `bottle :unneeded`" do
expect_no_offenses(<<~RUBY)
class Foo < Formula
url "https://brew.sh... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/bottle/bottle_digest_indentation_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,622 | # typed: false
# frozen_string_literal: true
require "rubocops/bottle"
RSpec.describe RuboCop::Cop::FormulaAudit::BottleDigestIndentation do
subject(:cop) { described_class.new }
it "reports no offenses for `bottle :unneeded`" do
expect_no_offenses(<<~RUBY)
class Foo < Formula
url "https://brew... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/bottle/bottle_format_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 4,046 | # typed: false
# frozen_string_literal: true
require "rubocops/bottle"
RSpec.describe RuboCop::Cop::FormulaAudit::BottleFormat do
subject(:cop) { described_class.new }
it "reports no offenses for `bottle :unneeded`" do
expect_no_offenses(<<~RUBY)
class Foo < Formula
url "https://brew.sh/foo-1.0... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/rubocops/bottle/bottle_order_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 6,261 | # typed: false
# frozen_string_literal: true
require "rubocops/bottle"
RSpec.describe RuboCop::Cop::FormulaAudit::BottleOrder do
subject(:cop) { described_class.new }
it "reports no offenses for `bottle :unneeded`" do
expect_no_offenses(<<~RUBY)
class Foo < Formula
url "https://brew.sh/foo-1.0.... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/zip_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 549 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Zip do
let(:path) { TEST_FIXTURE_DIR/"cask/MyFancyApp.zip" }
include_examples "UnpackStrategy::detect"
context "when unzip is available", :needs_unzip do
include_examples "#extract", children: ["... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/cvs_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 365 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Cvs do
let(:repo) do
mktmpdir.tap do |repo|
FileUtils.touch repo/"test"
(repo/"CVS").mkpath
end
end
let(:path) { repo }
include_examples "UnpackStrategy::detect"
include_exampl... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/shared_examples.rb | Ruby | bsd-2-clause | 47,751 | main | 485 | # typed: false
# frozen_string_literal: true
require "unpack_strategy"
RSpec.shared_examples "UnpackStrategy::detect" do
it "is correctly detected" do
expect(UnpackStrategy.detect(path)).to be_a described_class
end
end
RSpec.shared_examples "#extract" do |children: []|
specify "#extract" do
mktmpdir do... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/zstd_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 783 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Zstd do
let(:path) { TEST_FIXTURE_DIR/"cask/container.tar.zst" }
it "is correctly detected" do
# `UnpackStrategy.detect(path)` for a `.tar.XXX` file returns either `UnpackStrategy::Tar` if
# the... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/p7zip_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 224 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::P7Zip do
let(:path) { TEST_FIXTURE_DIR/"cask/container.7z" }
include_examples "UnpackStrategy::detect"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/subversion_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 784 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Subversion, :needs_svn do
let(:repo) { mktmpdir }
let(:working_copy) { mktmpdir }
let(:path) { working_copy }
before do
safe_system "svnadmin", "create", repo
safe_system "svn", "checkout", ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/jar_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 281 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Jar, :needs_unzip do
let(:path) { TEST_FIXTURE_DIR/"test.jar" }
include_examples "UnpackStrategy::detect"
include_examples "#extract", children: ["test.jar"]
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/bazaar_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 362 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Bazaar do
let(:repo) do
mktmpdir.tap do |repo|
FileUtils.touch repo/"test"
(repo/".bzr").mkpath
end
end
let(:path) { repo }
include_examples "UnpackStrategy::detect"
include_ex... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/lha_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 213 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Lha do
let(:path) { TEST_FIXTURE_DIR/"test.lha" }
include_examples "UnpackStrategy::detect"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/dmg_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 327 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Dmg, :needs_macos do
describe "#mount" do
let(:path) { TEST_FIXTURE_DIR/"cask/container.dmg" }
include_examples "UnpackStrategy::detect"
include_examples "#extract", children: ["container"]
e... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/tar_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 488 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Tar do
let(:path) { TEST_FIXTURE_DIR/"cask/container.tar.gz" }
include_examples "UnpackStrategy::detect"
include_examples "#extract", children: ["container"]
context "when TAR archive is corrupted"... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/bzip2_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 280 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Bzip2 do
let(:path) { TEST_FIXTURE_DIR/"cask/container.bz2" }
include_examples "UnpackStrategy::detect"
include_examples "#extract", children: ["container"]
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/rar_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 223 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Rar do
let(:path) { TEST_FIXTURE_DIR/"cask/container.rar" }
include_examples "UnpackStrategy::detect"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/xz_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 221 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Xz do
let(:path) { TEST_FIXTURE_DIR/"cask/container.xz" }
include_examples "UnpackStrategy::detect"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/mercurial_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 280 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Mercurial do
let(:repo) do
mktmpdir.tap do |repo|
(repo/".hg").mkpath
end
end
let(:path) { repo }
include_examples "UnpackStrategy::detect"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/directory_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 4,006 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Directory do
let(:path) do
mktmpdir.tap do |path|
FileUtils.touch path/"file"
FileUtils.ln_s "file", path/"symlink"
FileUtils.ln path/"file", path/"hardlink"
FileUtils.mkdir pat... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/gzip_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 278 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Gzip do
let(:path) { TEST_FIXTURE_DIR/"cask/container.gz" }
include_examples "UnpackStrategy::detect"
include_examples "#extract", children: ["container"]
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/lzip_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 213 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Lzip do
let(:path) { TEST_FIXTURE_DIR/"test.lz" }
include_examples "UnpackStrategy::detect"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/uncompressed_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 271 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Uncompressed do
let(:path) do
(mktmpdir/"test").tap do |path|
FileUtils.touch path
end
end
include_examples "UnpackStrategy::detect"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/xar_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 292 | # typed: true
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Xar, :needs_macos do
let(:path) { TEST_FIXTURE_DIR/"cask/container.xar" }
include_examples "UnpackStrategy::detect"
include_examples "#extract", children: ["container"]
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/unpack_strategy/git_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 493 | # typed: false
# frozen_string_literal: true
require_relative "shared_examples"
RSpec.describe UnpackStrategy::Git do
let(:repo) do
mktmpdir.tap do |repo|
system "git", "-C", repo, "init"
FileUtils.touch repo/"test"
system "git", "-C", repo, "add", "test"
system "git", "-C", repo, "comm... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/language/java_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,819 | # typed: false
# frozen_string_literal: true
require "language/java"
RSpec.describe Language::Java do
let(:f) do
formula("openjdk") do
url "openjdk"
version "15.0.1"
end
end
let(:expected_home) do
if OS.mac?
f.opt_libexec/"openjdk.jdk/Contents/Home"
else
f.opt_libexec
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/language/node_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,208 | # typed: false
# frozen_string_literal: true
require "language/node"
RSpec.describe Language::Node do
let(:npm_pack_cmd) { ["npm", "pack", "--ignore-scripts"] }
describe "#setup_npm_environment" do
before do
described_class.instance_variable_set(:@env_set, false)
end
it "calls prepend_path whe... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/language/python_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,045 | # typed: false
# frozen_string_literal: true
require "language/python"
RSpec.describe Language::Python, :needs_python do
describe "#major_minor_version" do
it "returns a Version for Python 2" do
expect(described_class).to receive(:major_minor_version).and_return(Version)
described_class.major_minor_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/language/node/shebang_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,406 | # typed: false
# frozen_string_literal: true
require "language/node"
require "utils/shebang"
RSpec.describe Language::Node::Shebang do
let(:file) { Tempfile.new("node-shebang") }
let(:broken_file) { Tempfile.new("node-shebang") }
let(:f) do
f = {}
f[:node18] = formula "node@18" do
url "https://br... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/language/perl/shebang_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,767 | # typed: false
# frozen_string_literal: true
require "language/perl"
require "utils/shebang"
RSpec.describe Language::Perl::Shebang do
let(:file) { Tempfile.new("perl-shebang") }
let(:broken_file) { Tempfile.new("perl-shebang") }
let(:f) do
f = {}
f[:perl] = formula "perl" do
url "https://brew.sh... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/language/python/virtualenv_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 13,029 | # typed: false
# frozen_string_literal: true
require "language/python"
require "resource"
RSpec.describe Language::Python::Virtualenv, :needs_python do
describe "#virtualenv_install_with_resources" do
let(:venv) { instance_double(Language::Python::Virtualenv::Virtualenv) }
let(:f) do
virtualenv_module... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/language/python/shebang_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,002 | # typed: false
# frozen_string_literal: true
require "language/python"
require "utils/shebang"
RSpec.describe Language::Python::Shebang do
let(:file) { Tempfile.new("python-shebang") }
let(:broken_file) { Tempfile.new("python-shebang") }
let(:f) do
f = {}
f[:python311] = formula "python@3.11" do
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/language/php/shebang_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,377 | # typed: false
# frozen_string_literal: true
require "language/php"
require "utils/shebang"
RSpec.describe Language::PHP::Shebang do
let(:file) { Tempfile.new("php-shebang") }
let(:broken_file) { Tempfile.new("php-shebang") }
let(:f) do
f = {}
f[:php81] = formula "php@8.1" do
url "https://brew.sh... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/keg_relocate/relocation_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,619 | # typed: false
# frozen_string_literal: true
require "keg_relocate"
RSpec.describe Keg::Relocation do
let(:prefix) { HOMEBREW_PREFIX.to_s }
let(:cellar) { HOMEBREW_CELLAR.to_s }
let(:repository) { HOMEBREW_REPOSITORY.to_s }
let(:library) { HOMEBREW_LIBRARY.to_s }
let(:prefix_placeholder) { "@@HOMEBREW_PREFI... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/keg_relocate/binary_relocation_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 958 | # typed: false
# frozen_string_literal: true
require "keg_relocate"
RSpec.describe Keg do
subject(:keg) { described_class.new(HOMEBREW_CELLAR/"foo/1.0.0") }
let(:dir) { HOMEBREW_CELLAR/"foo/1.0.0" }
let(:newdir) { HOMEBREW_CELLAR/"foo" }
let(:binary_file) { dir/"file.bin" }
before do
dir.mkpath
end
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/keg_relocate/text_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,088 | # typed: false
# frozen_string_literal: true
require "keg_relocate"
RSpec.describe Keg do
subject(:keg) { described_class.new(HOMEBREW_CELLAR/"foo/1.0.0") }
let(:dir) { mktmpdir }
let(:file) { dir/"file.txt" }
let(:placeholder) { "@@PLACEHOLDER@@" }
before do
(HOMEBREW_CELLAR/"foo/1.0.0").mkpath
end... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/keg_relocate/grep_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,165 | # typed: false
# frozen_string_literal: true
require "keg_relocate"
RSpec.describe Keg do
subject(:keg) { described_class.new(HOMEBREW_CELLAR/"foo/1.0.0") }
let(:dir) { HOMEBREW_CELLAR/"foo/1.0.0" }
let(:text_file) { dir/"file.txt" }
let(:binary_file) { dir/"file.bin" }
before do
dir.mkpath
end
d... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/formula_wrapper_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 16,496 | # typed: false
# frozen_string_literal: true
require "services/system"
require "services/formula_wrapper"
require "tempfile"
RSpec.describe Homebrew::Services::FormulaWrapper do
subject(:service) { described_class.new(formula) }
let(:formula) do
instance_double(Formula,
name: ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/system_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 5,978 | # typed: false
# frozen_string_literal: true
require "services/system"
RSpec.describe Homebrew::Services::System do
let(:bindir) { mktmpdir }
before do
described_class.reset_launchctl!
Homebrew::Services::System::Systemctl.reset_executable!
end
describe "#launchctl" do
it "returns the launchctl ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/formulae_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 878 | # typed: false
# frozen_string_literal: true
require "services/formulae"
RSpec.describe Homebrew::Services::Formulae do
describe "#services_list" do
it "empty list without available formulae" do
allow(described_class).to receive(:available_services).and_return({})
expect(described_class.services_lis... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/cli_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 13,111 | # typed: false
# frozen_string_literal: true
require "services/cli"
require "services/system"
require "services/formula_wrapper"
RSpec.describe Homebrew::Services::Cli do
subject(:services_cli) { described_class }
let(:service_string) { "service" }
describe "#bin" do
it "outputs command name" do
exp... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/commands/list_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 5,117 | # typed: false
# frozen_string_literal: true
require "services/commands/list"
RSpec.describe Homebrew::Services::Commands::List do
describe "#TRIGGERS" do
it "contains all restart triggers" do
expect(described_class::TRIGGERS).to eq([nil, "list", "ls"])
end
end
describe "#run" do
it "fails wi... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/commands/info_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,792 | # typed: false
# frozen_string_literal: true
require "services/commands/info"
RSpec.describe Homebrew::Services::Commands::Info do
before do
allow_any_instance_of(IO).to receive(:tty?).and_return(false)
end
describe "#TRIGGERS" do
it "contains all restart triggers" do
expect(described_class::TRIG... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/commands/cleanup_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,716 | # typed: false
# frozen_string_literal: true
require "services/commands/cleanup"
require "services/system"
require "services/cli"
RSpec.describe Homebrew::Services::Commands::Cleanup do
describe "#TRIGGERS" do
it "contains all restart triggers" do
expect(described_class::TRIGGERS).to eq(%w[cleanup clean c... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/commands/restart_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,948 | # typed: false
# frozen_string_literal: true
require "services/commands/restart"
RSpec.describe Homebrew::Services::Commands::Restart do
describe "#TRIGGERS" do
it "contains all restart triggers" do
expect(described_class::TRIGGERS).to eq(%w[restart relaunch reload r])
end
end
describe "#run" do
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/services/system/systemctl_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 965 | # typed: false
# frozen_string_literal: true
require "services/system"
require "services/system/systemctl"
RSpec.describe Homebrew::Services::System::Systemctl do
let(:bindir) { mktmpdir }
describe ".scope" do
it "outputs systemctl scope for user" do
allow(Homebrew::Services::System).to receive(:root?)... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/requirements/codesign_requirement_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 608 | # typed: false
# frozen_string_literal: true
require "requirements/codesign_requirement"
RSpec.describe CodesignRequirement do
subject(:requirement) do
described_class.new([{ identity:, with:, url: }])
end
let(:identity) { "lldb_codesign" }
let(:with) { "LLDB" }
let(:url) do
"https://llvm.org/svn/l... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/requirements/arch_requirement_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 322 | # typed: false
# frozen_string_literal: true
require "requirements/arch_requirement"
RSpec.describe ArchRequirement do
subject(:requirement) { described_class.new([Hardware::CPU.type]) }
describe "#satisfied?" do
it "supports architecture symbols" do
expect(requirement).to be_satisfied
end
end
en... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/requirements/macos_requirement_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,967 | # typed: false
# frozen_string_literal: true
require "requirements/macos_requirement"
RSpec.describe MacOSRequirement do
subject(:requirement) { described_class.new }
let(:macos_oldest_allowed) { MacOSVersion.new(HOMEBREW_MACOS_OLDEST_ALLOWED) }
let(:macos_newest_allowed) { MacOSVersion.new(HOMEBREW_MACOS_NEWE... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/requirements/linux_requirement_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 306 | # typed: false
# frozen_string_literal: true
require "requirements/linux_requirement"
RSpec.describe LinuxRequirement do
subject(:requirement) { described_class.new }
describe "#satisfied?" do
it "returns true on Linux" do
expect(requirement.satisfied?).to eq(OS.linux?)
end
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/hardware/cpu_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,390 | # typed: false
# frozen_string_literal: true
require "hardware"
RSpec.describe Hardware::CPU do
describe "::type" do
let(:cpu_types) do
[
:arm,
:intel,
:ppc,
:dunno,
]
end
it "returns the current CPU's type as a symbol, or :dunno if it cannot be detected" do
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/pkg_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 6,015 | # typed: false
# frozen_string_literal: true
RSpec.describe Cask::Pkg, :cask do
describe "#uninstall" do
let(:fake_system_command) { NeverSudoSystemCommand }
let(:empty_response) do
instance_double(
SystemCommand::Result,
stdout: "",
plist: { "volume" => "/", "install-location"... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/info_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 12,294 | # typed: false
# frozen_string_literal: true
require "utils"
require "cask/info"
RSpec.describe Cask::Info, :cask do
include Utils::Output::Mixin
let(:args) { instance_double(Homebrew::Cmd::Info::Args) }
def uninstalled(string)
"#{Tty.bold}#{string} #{Formatter.error("✘")}#{Tty.reset}"
end
def instal... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/caskroom_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,287 | # typed: false
# frozen_string_literal: true
require "cask/caskroom"
RSpec.describe Cask::Caskroom do
describe ".corrupt_cask_dirs" do
it "returns tokens for directories without valid caskfiles" do
Dir.mktmpdir do |dir|
allow(described_class).to receive(:path).and_return(Pathname(dir))
(Pa... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/list_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 4,328 | # typed: false
# frozen_string_literal: true
require "cask/list"
RSpec.describe Cask::List, :cask do
it "lists the installed Casks in a pretty fashion" do
casks = %w[local-caffeine local-transmission].map { |c| Cask::CaskLoader.load(c) }
casks.each do |c|
InstallHelper.install_with_caskfile(c)
en... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/migrator_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,425 | # typed: false
# frozen_string_literal: true
require "cask/migrator"
RSpec.describe Cask::Migrator do
describe ".migrate_if_needed" do
let(:new_cask) do
instance_double(
Cask::Cask,
old_tokens: ["old-token"],
installed_caskfile:,
token: new_token,
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/quarantine_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,829 | # typed: false
# frozen_string_literal: true
RSpec.describe Cask::Quarantine do
describe ".user_approved?" do
let(:file) { Pathname("/tmp/Test.app") }
before do
allow(described_class).to receive(:xattr).and_return(Pathname("/usr/bin/xattr"))
end
it "returns true when the user approval flag is... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/uninstall_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 11,875 | # typed: false
# frozen_string_literal: true
require "cask/uninstall"
RSpec.describe Cask::Uninstall, :cask do
describe ".uninstall_casks" do
it "displays the uninstallation progress" do
caffeine = Cask::CaskLoader.load(cask_path("local-caffeine"))
Cask::Installer.new(caffeine).install
outpu... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/cask_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 30,793 | # typed: false
# frozen_string_literal: true
RSpec.describe Cask::Cask, :cask do
def write_info_plist(path, short_version: nil, bundle_version: nil, contents: nil)
info_plist = path/"Contents/Info.plist"
info_plist.dirname.mkpath
if contents
info_plist.write(contents)
return
end
ent... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/installer_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 22,324 | # typed: false
# frozen_string_literal: true
RSpec.describe Cask::Installer, :cask do
describe "install" do
it "downloads and installs a nice fresh Cask" do
caffeine = Cask::CaskLoader.load(cask_path("local-caffeine"))
described_class.new(caffeine).install
expect(Cask::Caskroom.path.join("loc... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cask/dsl_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 17,508 | # typed: false
# frozen_string_literal: true
RSpec.describe Cask::DSL, :cask, :no_api do
let(:cask) { Cask::CaskLoader.load(token) }
let(:token) { "basic-cask" }
describe "stanzas" do
it "lets you set url, homepage and version" do
expect(cask.url.to_s).to eq("https://brew.sh/TestCask-1.2.3.dmg")
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.