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/cmd/analytics_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 589 | # typed: false
# frozen_string_literal: true
require "cmd/analytics"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Analytics do
it_behaves_like "parseable arguments"
it "when HOMEBREW_NO_ANALYTICS is unset is disabled after running `brew analytics off`", :integration_test do
HOMEBREW... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/alias_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 521 | # typed: false
# frozen_string_literal: true
require "cmd/alias"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Alias do
it_behaves_like "parseable arguments"
it "sets an alias", :integration_test do
expect { brew "alias", "foo-test=bar" }
.to not_to_output.to_stdout
.and ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/services_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 416 | # typed: false
# frozen_string_literal: true
require "cmd/services"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Services, :needs_daemon_manager do
it_behaves_like "parseable arguments"
it "allows controlling services", :integration_test do
expect { brew "services", "list" }
.... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/cleanup_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 757 | # typed: false
# frozen_string_literal: true
require "cmd/cleanup"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::CleanupCmd do
before do
FileUtils.mkdir_p HOMEBREW_LIBRARY/"Homebrew/vendor/"
FileUtils.touch HOMEBREW_LIBRARY/"Homebrew/vendor/portable-ruby-version"
end
after do
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/--version_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 337 | # typed: false
# frozen_string_literal: true
RSpec.describe "brew --version", type: :system do
it "prints the Homebrew's version", :integration_test do
expect { brew_sh "--version" }
.to output(/^Homebrew #{Regexp.escape(HOMEBREW_VERSION)}\n/o).to_stdout
.and not_to_output.to_stderr
.and be_a_s... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/uses_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,103 | # typed: false
# frozen_string_literal: true
require "cli/named_args"
require "cmd/shared_examples/args_parse"
require "cmd/uses"
require "fileutils"
RSpec.describe Homebrew::Cmd::Uses do
include FileUtils
it_behaves_like "parseable arguments"
it "prints the Formulae a given Formula is used by", :integration_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/tap_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 386 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/tap"
RSpec.describe Homebrew::Cmd::TapCmd do
it_behaves_like "parseable arguments"
it "taps a given Tap", :integration_test do
path = setup_test_tap
expect { brew "tap", "homebrew/bar", path/".git" }
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/shellenv_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 285 | # typed: false
# frozen_string_literal: true
RSpec.describe "brew shellenv", type: :system do
it "prints export statements", :integration_test do
expect { brew_sh "shellenv" }
.to output(/.*/).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/custom-external-command_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 584 | # typed: false
# frozen_string_literal: true
RSpec.describe "brew custom-external-command", :integration_test, type: :system do
it "is supported" do
mktmpdir do |path|
cmd = "custom-external-command-#{rand}"
file = path/"brew-#{cmd}"
file.write <<~SH
#!/bin/sh
echo 'I am #{cmd}... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/developer_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 433 | # typed: false
# frozen_string_literal: true
require "cmd/developer"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Developer do
it_behaves_like "parseable arguments"
it "prints that Developer mode is disabled by default", :integration_test do
expect { brew "developer" }
.to out... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/home_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,958 | # typed: false
# frozen_string_literal: true
require "cmd/home"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Home do
let(:testballhome_homepage) do
Formula["testballhome"].homepage
end
let(:local_caffeine_path) do
cask_path("local-caffeine")
end
let(:local_caffeine_homepa... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/pyenv-sync_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 201 | # typed: strict
# frozen_string_literal: true
require "cmd/pyenv-sync"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::PyenvSync do
it_behaves_like "parseable arguments"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/source_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 6,016 | # typed: false
# frozen_string_literal: true
require "cmd/source"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Source do
it_behaves_like "parseable arguments"
it "opens the Homebrew repo when no formula is specified", :integration_test do
expect { brew "source", "HOMEBREW_BROWSER" =... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/update_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,248 | # typed: false
# frozen_string_literal: true
require "open3"
require "cmd/shared_examples/args_parse"
require "cmd/update"
RSpec.describe Homebrew::Cmd::Update do
let(:update_script) { repository_root/"Library/Homebrew/cmd/update.sh" }
let(:test_root) do
(repository_root/"tmp").mkpath
Pathname(Dir.mktmpd... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/version-install_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 4,950 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/version-install"
RSpec.describe Homebrew::Cmd::VersionInstall do
subject(:version_install) { described_class.new(args) }
let(:formulary_factory) { ->(ref, **_opts) { raise FormulaUnavailableError, ref } }
let(:in... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/log_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 984 | # typed: false
# frozen_string_literal: true
require "cmd/log"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Log do
it_behaves_like "parseable arguments"
it "shows the Git log for a given Formula", :integration_test do
setup_test_formula "testball"
core_tap = CoreTap.instance
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/help_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 674 | # typed: false
# frozen_string_literal: true
require "cmd/help"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::HelpCmd, :integration_test do
it_behaves_like "parseable arguments"
describe "help" do
it "prints help for a documented Ruby command" do
expect { brew "help", "cat" }
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/--repository_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 899 | # typed: false
# frozen_string_literal: true
RSpec.describe "brew --repository", type: :system do
it "prints Homebrew's repository", :integration_test do
expect { brew_sh "--repository" }
.to output("#{ENV.fetch("HOMEBREW_REPOSITORY")}\n").to_stdout
.and not_to_output.to_stderr
.and be_a_succes... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/readall_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 620 | # typed: false
# frozen_string_literal: true
require "cmd/readall"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::ReadallCmd do
it_behaves_like "parseable arguments"
it "imports all Formulae for a given Tap", :integration_test do
formula_file = setup_test_formula "testball"
alias... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/install_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 8,211 | # typed: false
# frozen_string_literal: true
require "cmd/install"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::InstallCmd do
include FileUtils
it_behaves_like "parseable arguments"
it "installs an explicitly requested tap before resolving a formula" do
cmd = described_class.new(... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/unpin_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 421 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/unpin"
RSpec.describe Homebrew::Cmd::Unpin do
it_behaves_like "parseable arguments"
it "unpins a Formula's version", :integration_test do
setup_test_formula "testball", tab_attributes: { installed_on_request: t... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/reinstall_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,962 | # typed: false
# frozen_string_literal: true
require "extend/ENV"
require "cmd/reinstall"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Reinstall do
it_behaves_like "parseable arguments"
it "reports unavailable names via ofail and continues reinstalling" do
error = FormulaOrCaskUnava... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/postinstall_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 204 | # typed: strict
# frozen_string_literal: true
require "cmd/postinstall"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Postinstall do
it_behaves_like "parseable arguments"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/command_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 415 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/command"
RSpec.describe Homebrew::Cmd::Command do
it_behaves_like "parseable arguments"
it "returns the file for a given command", :integration_test do
expect { brew "command", "info" }
.to output(%r{#{Re... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/deps_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,033 | # typed: false
# frozen_string_literal: true
require "cmd/deps"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Deps, :integration_test, :no_api do
include FileUtils
before do
setup_test_formula "bar"
setup_test_formula "foo"
setup_test_formula "test"
setup_test_formula "bu... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/formulae_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 256 | # typed: false
# frozen_string_literal: true
RSpec.describe "brew formulae", type: :system do
it "prints all installed Formulae", :integration_test do
expect { brew_sh "formulae" }
.to be_a_success
.and not_to_output.to_stderr
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/--cache_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,659 | # typed: false
# frozen_string_literal: true
require "cmd/--cache"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Cache do
it_behaves_like "parseable arguments"
it "prints all cache files for a given Formula", :integration_test do
expect { brew "--cache", testball }
.to output(%... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/command-not-found-init_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 223 | # typed: strict
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/command-not-found-init"
RSpec.describe Homebrew::Cmd::CommandNotFoundInit do
it_behaves_like "parseable arguments"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/outdated_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,405 | # typed: false
# frozen_string_literal: true
require "cmd/outdated"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Outdated do
it_behaves_like "parseable arguments"
it "skips auto-updating casks without --greedy-auto-updates", :cask do
cask = Cask::CaskLoader.load(cask_path("auto-upda... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/doctor_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,215 | # typed: false
# frozen_string_literal: true
require "cmd/doctor"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Doctor do
it_behaves_like "parseable arguments"
specify "check_integration_test", :integration_test do
expect { brew "doctor", "check_integration_test" }
.to output(/... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/desc_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,227 | # typed: false
# frozen_string_literal: true
require "cmd/desc"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Desc do
it_behaves_like "parseable arguments"
it "shows a given Formula's description", :integration_test do
setup_test_formula "testball"
expect { brew "desc", "testbal... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/commands_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 414 | # typed: false
# frozen_string_literal: true
require "cmd/commands"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::CommandsCmd do
it_behaves_like "parseable arguments"
it "prints a list of all available commands", :integration_test do
expect { brew "commands" }
.to output(/Built... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/docs_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 414 | # typed: false
# frozen_string_literal: true
require "cmd/docs"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Docs do
it_behaves_like "parseable arguments"
it "opens the docs page", :integration_test do
expect { brew "docs", "HOMEBREW_BROWSER" => "echo" }
.to output("https://do... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/nodenv-sync_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 203 | # typed: strict
# frozen_string_literal: true
require "cmd/nodenv-sync"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::NodenvSync do
it_behaves_like "parseable arguments"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/untap_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,883 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/untap"
RSpec.describe Homebrew::Cmd::Untap do
let(:class_instance) { described_class.new(%w[arg1]) }
it_behaves_like "parseable arguments"
it "untaps a given Tap", :integration_test do
setup_test_tap
ex... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/update-report_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 9,882 | # typed: false
# frozen_string_literal: true
require "cmd/update-report"
require "formula_versions"
require "yaml"
require "cmd/shared_examples/args_parse"
require "cmd/shared_examples/reinstall_pkgconf_if_needed"
RSpec.describe Homebrew::Cmd::UpdateReport do
it_behaves_like "parseable arguments"
it_behaves_like... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/options_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 567 | # typed: false
# frozen_string_literal: true
require "cmd/options"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::OptionsCmd do
it_behaves_like "parseable arguments"
it "prints a given Formula's options", :integration_test do
setup_test_formula "testball", <<~RUBY
depends_on "ba... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/mcp-server_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 521 | # typed: false
# frozen_string_literal: true
RSpec.describe "brew mcp-server", type: :system do
it "starts the MCP server", :integration_test do
# This is the easiest way to handle a newline here.
# rubocop:disable Style/StringConcatenation
expect { brew_sh "mcp-server", "--ping" }
.to output("==> ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/casks_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 247 | # typed: false
# frozen_string_literal: true
RSpec.describe "brew casks", type: :system do
it "prints all installed Casks", :integration_test do
expect { brew_sh "casks" }
.to be_a_success
.and not_to_output.to_stderr
end
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/search_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,939 | # typed: false
# frozen_string_literal: true
require "cmd/search"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::SearchCmd do
it_behaves_like "parseable arguments"
it "finds formula in search", :integration_test, :no_api do
setup_test_formula "testball"
expect { brew "search", "t... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/tap-info_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 736 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/tap-info"
RSpec.describe Homebrew::Cmd::TapInfo do
it_behaves_like "parseable arguments"
it "gets information for a given Tap", :integration_test, :needs_network do
setup_test_tap
expect { brew "tap-info",... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/link_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,642 | # typed: false
# frozen_string_literal: true
require "cmd/link"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Link do
it_behaves_like "parseable arguments"
it "uses formula-aware conflict handling when linking a Formula" do
formula = formula "testball" do
url "foo-1.0"
end
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/unalias_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 768 | # typed: false
# frozen_string_literal: true
require "cmd/unalias"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Unalias do
it_behaves_like "parseable arguments"
it "unsets an alias", :integration_test do
expect { brew "alias", "foo=bar" }
.to not_to_output.to_stdout
.and... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/--prefix_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,184 | # typed: false
# frozen_string_literal: true
require "cmd/--prefix"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Prefix do
it_behaves_like "parseable arguments"
it "prints Homebrew's prefix", :integration_test do
expect { brew_sh "--prefix" }
.to output("#{ENV.fetch("HOMEBREW_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/leaves_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,178 | # typed: false
# frozen_string_literal: true
require "cmd/leaves"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Leaves do
it_behaves_like "parseable arguments"
context "when there are no installed Formulae", :integration_test do
it "prints nothing" do
setup_test_formula "foo"
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/unlink_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 428 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/unlink"
RSpec.describe Homebrew::Cmd::UnlinkCmd do
it_behaves_like "parseable arguments"
it "unlinks a Formula", :integration_test do
install_test_formula "testball"
expect { brew "unlink", "testball" }
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/pin_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 544 | # typed: false
# frozen_string_literal: true
require "cmd/pin"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Pin do
it_behaves_like "parseable arguments"
it "pins a Formula's version", :integration_test do
setup_test_formula "testball", tab_attributes: { installed_on_request: true }
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/info_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 9,337 | # typed: false
# frozen_string_literal: true
require "cmd/info"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Info do
RSpec::Matchers.define :a_json_string do
match do |actual|
JSON.parse(actual)
true
rescue JSON::ParserError
false
end
end
it_behaves_like ... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/autoremove_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,335 | # typed: false
# frozen_string_literal: true
require "cmd/autoremove"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Autoremove do
it_behaves_like "parseable arguments"
describe "integration test" do
let(:requested_formula) { Formula["testball1"] }
let(:unused_formula) { Formula["... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/tab_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,103 | # typed: false
# frozen_string_literal: true
require "cmd/tab"
require "cmd/shared_examples/args_parse"
require "tab"
RSpec.describe Homebrew::Cmd::TabCmd do
def installed_on_request?(formula)
# `brew` subprocesses can change the tab, invalidating the cached values.
Tab.clear_cache
Tab.for_formula(formu... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/migrate_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 575 | # typed: false
# frozen_string_literal: true
require "cmd/migrate"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Migrate do
it_behaves_like "parseable arguments"
it "migrates a renamed Formula", :integration_test, :no_api do
setup_test_formula "testball1"
setup_test_formula "test... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/upgrade_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 7,563 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/upgrade"
require "cmd/shared_examples/reinstall_pkgconf_if_needed"
RSpec.describe Homebrew::Cmd::UpgradeCmd do
include FileUtils
it_behaves_like "parseable arguments"
it "upgrades a Formula", :integration_test d... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/vendor-install_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,632 | # typed: false
# frozen_string_literal: true
require "open3"
require "shellwords"
# This spec exercises a shell helper rather than a Ruby class API.
# rubocop:disable RSpec/DescribeClass
RSpec.describe "vendor-install.sh" do
let(:vendor_dir) { mktmpdir("vendor-install")/"vendor" }
let(:vendor_root) { vendor_dir/"... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/bundle_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 709 | # typed: false
# frozen_string_literal: true
require "cmd/bundle"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Bundle do
it_behaves_like "parseable arguments"
it "checks if a Brewfile's dependencies are satisfied", :integration_test do
HOMEBREW_REPOSITORY.cd do
system "git", "... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/--cellar_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 642 | # typed: false
# frozen_string_literal: true
require "cmd/--cellar"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Cellar do
it_behaves_like "parseable arguments"
it "prints Homebrew's Cellar", :integration_test do
expect { brew_sh "--cellar" }
.to output("#{ENV.fetch("HOMEBREW_... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/list_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 692 | # typed: false
# frozen_string_literal: true
require "cmd/list"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::List do
let(:formulae) { %w[bar foo qux] }
it_behaves_like "parseable arguments"
it "prints all installed formulae", :integration_test do
formulae.each do |f|
(HOMEB... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/rbenv-sync_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 201 | # typed: strict
# frozen_string_literal: true
require "cmd/rbenv-sync"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::RbenvSync do
it_behaves_like "parseable arguments"
end |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/gist-logs_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,074 | # typed: false
# frozen_string_literal: true
require "cmd/gist-logs"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::GistLogs do
it_behaves_like "parseable arguments"
describe ".truncate_text_to_approximate_size" do
let(:glue) { "\n[...snip...]\n" } # hard-coded copy from truncate_text... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/missing_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 715 | # typed: false
# frozen_string_literal: true
require "cmd/missing"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Missing do
it_behaves_like "parseable arguments"
it "prints missing dependencies", :integration_test, :no_api do
setup_test_formula "foo"
setup_test_formula "bar"
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/config_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 740 | # typed: false
# frozen_string_literal: true
require "cmd/config"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Config do
it_behaves_like "parseable arguments"
it "prints information about the current Homebrew configuration", :integration_test do
expect { brew "config" }
.to ou... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/--caskroom_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 803 | # typed: false
# frozen_string_literal: true
require "cmd/--caskroom"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Caskroom do
it_behaves_like "parseable arguments"
it "prints Homebrew's Caskroom", :integration_test do
expect { brew_sh "--caskroom" }
.to output("#{ENV.fetch("H... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/--env_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 528 | # typed: false
# frozen_string_literal: true
require "cmd/--env"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::Env do
it_behaves_like "parseable arguments"
describe "--shell=bash", :integration_test do
it "prints the Homebrew build environment variables in Bash syntax" do
expec... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/completions_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 522 | # typed: false
# frozen_string_literal: true
require "cmd/completions"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::CompletionsCmd do
it_behaves_like "parseable arguments"
it "runs the status subcommand correctly", :integration_test do
HOMEBREW_REPOSITORY.cd do
system "git", "... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/uninstall_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,254 | # typed: false
# frozen_string_literal: true
require "cmd/uninstall"
require "cmd/shared_examples/args_parse"
RSpec.describe Homebrew::Cmd::UninstallCmd do
it_behaves_like "parseable arguments"
it "uninstalls a given Formula", :integration_test do
setup_test_formula "testball", tab_attributes: { installed_on... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/which-formula_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,005 | # typed: false
# frozen_string_literal: true
require "cmd/shared_examples/args_parse"
require "cmd/which-formula"
RSpec.describe Homebrew::Cmd::WhichFormula do
it_behaves_like "parseable arguments"
describe "which_formula" do
before do
# Override DATABASE_FILE to use test environment's HOMEBREW_CACHE
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/shared_examples/args_parse.rb | Ruby | bsd-2-clause | 47,751 | main | 681 | # typed: false
# frozen_string_literal: true
RSpec.shared_examples "parseable arguments" do |command_name: nil|
let(:command) do |example|
example.metadata.dig(:example_group, :parent_example_group, :description)
end
it "can parse arguments" do
if described_class
klass = described_class
else
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/cmd/shared_examples/reinstall_pkgconf_if_needed.rb | Ruby | bsd-2-clause | 47,751 | main | 3,244 | # typed: false
# frozen_string_literal: true
require "reinstall"
require "formula_installer"
RSpec.shared_examples "reinstall_pkgconf_if_needed" do
context "when running on macOS", :needs_macos do
describe ".reinstall_pkgconf_if_needed!" do
let(:formula) { instance_double(Formula) }
let(:formula_ins... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/os_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 468 | # typed: false
# frozen_string_literal: true
RSpec.describe OS do
describe "::kernel_version" do
it "is not NULL" do
expect(described_class.kernel_version).not_to be_null
end
end
describe "::kernel_name" do
it "returns Linux on Linux", :needs_linux do
expect(described_class.kernel_name).... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,513 | # typed: false
# frozen_string_literal: true
require "locale"
require "os/mac"
RSpec.describe OS::Mac do
describe "::languages" do
it "returns a list of all languages" do
expect(described_class.languages).not_to be_empty
end
end
describe "::language" do
it "returns the first item from #langua... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 893 | # typed: false
# frozen_string_literal: true
require "locale"
require "os/linux"
RSpec.describe OS::Linux do
describe "::languages", :needs_linux do
it "returns a list of all languages" do
expect(described_class.languages).not_to be_empty
end
end
describe "::language", :needs_linux do
it "ret... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux/dependency_collector_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,126 | # typed: false
# frozen_string_literal: true
require "dependency_collector"
RSpec.describe DependencyCollector do
alias_matcher :be_a_build_requirement, :be_build
subject(:collector) { described_class.new }
describe "#add" do
let(:resource) { Resource.new }
context "when xz, unzip and bzip2 are not a... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux/formula_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,846 | # typed: false
# frozen_string_literal: true
require "test/support/fixtures/testball"
require "formula"
RSpec.describe Formula do
describe "#uses_from_macos" do
before do
allow(OS).to receive(:mac?).and_return(false)
end
it "acts like #depends_on" do
f = formula "foo" do
url "foo-1.... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux/pathname_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,899 | # typed: false
# frozen_string_literal: true
require "extend/pathname"
RSpec.describe Pathname do
let(:elf_dir) { ELFPathname.wrap("#{TEST_FIXTURE_DIR}/elf") }
let(:sho) { ELFPathname.wrap(elf_dir/"libforty.so.0") }
let(:sho_without_runpath_rpath) { ELFPathname.wrap(elf_dir/"libhello.so.0") }
let(:exec) { ELF... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux/formula_installer_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 686 | # typed: false
# frozen_string_literal: true
require "formula_installer"
require "test/support/fixtures/testball"
RSpec.describe FormulaInstaller do
include FileUtils
subject(:keg) { described_class.new(keg_path) }
describe "#fresh_install" do
subject(:formula_installer) { described_class.new(Testball.new... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux/libstdcxx_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,069 | # typed: false
# frozen_string_literal: true
require "os/linux/libstdcxx"
RSpec.describe OS::Linux::Libstdcxx do
describe "::below_ci_version?" do
it "returns false when system version matches CI version" do
allow(described_class).to receive(:system_version).and_return(Version.new(OS::LINUX_LIBSTDCXX_CI_V... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux/ld_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,190 | # typed: false
# frozen_string_literal: true
require "os/linux/ld"
require "tmpdir"
RSpec.describe OS::Linux::Ld do
let(:diagnostics) do
<<~EOS
path.prefix="/usr"
path.sysconfdir="/usr/local/etc"
path.system_dirs[0x0]="/lib64"
path.system_dirs[0x1]="/var/lib"
EOS
end
describe ":... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux/elf_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,969 | # typed: false
# frozen_string_literal: true
RSpec.describe OS::Linux::Elf do
describe "::expand_elf_dst" do
it "expands tokens that are not wrapped in curly braces" do
str = "$ORIGIN/../lib"
ref = "ORIGIN"
repl = "/opt/homebrew/bin"
expected = "/opt/homebrew/bin/../lib"
expect(desc... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/linux/diagnostic_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,471 | # typed: false
# frozen_string_literal: true
require "diagnostic"
RSpec.describe Homebrew::Diagnostic::Checks do
subject(:checks) { described_class.new }
specify "#check_supported_architecture" do
allow(Hardware::CPU).to receive(:type).and_return(:arm64)
expect(checks.check_supported_architecture)
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/keg_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 841 | # typed: false
# frozen_string_literal: true
require "keg"
RSpec.describe Keg do
include FileUtils
subject(:keg) { described_class.new(keg_path) }
describe "#mach_o_files" do
let(:keg_path) { HOMEBREW_CELLAR/"a/1.0" }
before { (keg_path/"lib").mkpath }
after { keg.unlink }
it "skips hardlin... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/mach_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 4,819 | # typed: false
# frozen_string_literal: true
RSpec.describe MachOShim do
describe "Pathname tests" do
specify "fat dylib" do
pn = dylib_path("fat")
expect(pn).to be_universal
expect(pn).not_to be_i386
expect(pn).not_to be_x86_64
expect(pn).not_to be_ppc7400
expect(pn).not_to b... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/formula_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,498 | # typed: false
# frozen_string_literal: true
require "test/support/fixtures/testball"
require "formula"
RSpec.describe Formula do
describe "#uses_from_macos" do
before do
allow(OS).to receive(:mac?).and_return(true)
allow(OS::Mac).to receive(:version).and_return(MacOSVersion.from_symbol(:sonoma))
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/dependency_collector_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,190 | # typed: false
# frozen_string_literal: true
require "dependency_collector"
RSpec.describe DependencyCollector do
alias_matcher :need_tar_xz_dependency, :be_tar_needs_xz_dependency
subject(:collector) { described_class.new }
specify "Resource dependency from a '.xz' URL" do
resource = Resource.new
res... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/diagnostic_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 7,854 | # typed: false
# frozen_string_literal: true
require "diagnostic"
RSpec.describe Homebrew::Diagnostic::Checks do
subject(:checks) { described_class.new }
specify "#check_for_unsupported_macos" do
ENV.delete("HOMEBREW_DEVELOPER")
macos_version = MacOSVersion.new("30")
allow(OS::Mac).to receive_messag... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/pkgconfig_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 5,083 | # typed: false
# frozen_string_literal: true
# These tests assume the needed SDKs are correctly installed, i.e. `brew doctor` passes.
# The CLT version installed should be the latest available for the running OS.
# The tests do not check other OS versions beyond than the one the tests are being run on.
#
# It is not p... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/sdk_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,714 | # typed: false
# frozen_string_literal: true
RSpec.describe OS::Mac::CLTSDKLocator do
subject(:locator) { described_class.new }
let(:big_sur_sdk) { OS::Mac::SDK.new(MacOSVersion.new("11"), "/some/path/MacOSX.sdk", :clt) }
let(:catalina_sdk) { OS::Mac::SDK.new(MacOSVersion.new("10.15"), "/some/path/MacOSX10.15.s... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/reinstall_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,451 | # typed: false
# frozen_string_literal: true
require "reinstall"
require "extend/os/mac/pkgconf"
RSpec.describe Homebrew::Reinstall do
describe ".reinstall_pkgconf_if_needed!" do
let(:formula) { instance_double(Formula) }
let(:formula_installer) do
instance_double(FormulaInstaller, formula:, prelude_f... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/os/mac/formula_installer_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 908 | # typed: false
# frozen_string_literal: true
require "formula_installer"
require "test/support/fixtures/testball"
RSpec.describe FormulaInstaller do
include FileUtils
subject(:keg) { described_class.new(keg_path) }
describe "#fresh_install" do
subject(:formula_installer) { described_class.new(Testball.new... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/extend/kernel_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,311 | # typed: false
# frozen_string_literal: true
RSpec.describe Kernel do
let(:dir) { mktmpdir }
describe "#interactive_shell" do
let(:shell) { dir/"myshell" }
it "starts an interactive shell session" do
File.write shell, <<~SH
#!/bin/sh
echo called > "#{dir}/called"
SH
Fil... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/extend/array_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 2,090 | # typed: false
# frozen_string_literal: true
require "extend/array"
RSpec.describe Array do
describe ".to_sentence" do
it "converts a plain array to a sentence" do
expect([].to_sentence).to eq("")
expect(["one"].to_sentence).to eq("one")
expect(["one", "two"].to_sentence).to eq("one and two")
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/extend/blank_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,515 | # typed: false
# frozen_string_literal: true
require "extend/blank"
RSpec.describe Object do
let(:empty_true) do
Class.new(described_class) do
# This API is intentionally non-ideal for testing.
# rubocop:disable Naming/PredicateMethod
def empty?
0
end
# rubocop:enable Namin... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/extend/pathname/write_mkpath_extension_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,841 | # typed: false
# frozen_string_literal: true
require "extend/pathname/write_mkpath_extension"
# Use a copy of Pathname with the WriteMkpathExtension prepended to avoid affecting the original class for all tests
class PathnameCopy < Pathname
PathnameCopy.prepend WriteMkpathExtension
end
RSpec.describe WriteMkpathEx... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/popen_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,074 | # typed: false
# frozen_string_literal: true
require "utils/popen"
RSpec.describe Utils do
describe "::popen_read" do
it "reads the standard output of a given command" do
expect(described_class.popen_read("sh", "-c", "echo success").chomp).to eq("success")
expect($CHILD_STATUS).to be_a_success
e... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/fork_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 594 | # typed: false
# frozen_string_literal: true
require "utils/fork"
RSpec.describe Utils do
describe "#safe_fork" do
it "raises a RuntimeError on an error that isn't ErrorDuringExecution" do
expect do
described_class.safe_fork do
raise "this is an exception in the child"
end
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/curl_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 32,768 | # typed: false
# frozen_string_literal: true
require "utils/curl"
RSpec.describe "Utils::Curl" do
include Utils::Curl
let(:details) do
details = {
normal: {},
cloudflare: {},
incapsula: {},
}
details[:normal][:no_cookie] = {
url: "https://www.example.com/",
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/ruby_check_version_script_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 1,535 | # typed: false
# frozen_string_literal: true
RSpec.describe Utils do
describe "ruby_check_version_script" do
subject do
homebrew_env = ENV.select { |key, _| key.start_with?("HOMEBREW_") }
Bundler.with_unbundled_env do
ENV.delete_if { |key,| key.start_with?("HOMEBREW_") }
ENV.update(ho... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/shared_audits_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 4,022 | # typed: false
# frozen_string_literal: true
require "utils/shared_audits"
require "utils/curl"
RSpec.describe SharedAudits do
let(:eol_json_text) do
<<~JSON
{
"schema_version" : "1.0.0",
"generated_at": "2025-01-02T01:23:45+00:00",
"result": {
"name": "1.2",
"c... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/service_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 850 | # typed: false
# frozen_string_literal: true
require "utils/service"
RSpec.describe Utils::Service do
describe "::systemd_quote" do
it "quotes empty strings correctly" do
expect(described_class.systemd_quote("")).to eq '""'
end
it "quotes strings with special characters escaped correctly" do
... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/autoremove_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 6,072 | # typed: false
# frozen_string_literal: true
require "utils/autoremove"
RSpec.describe Utils::Autoremove do
shared_context "with formulae for dependency testing" do
let(:formula_with_deps) do
formula "zero" do
url "zero-1.0"
depends_on "three" => :build
end
end
let(:first_f... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/git_repository_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,606 | # typed: false
# frozen_string_literal: true
require "utils/git_repository"
RSpec.describe Utils do
shared_examples "git_repository helper function" do |method_name|
context "when directory is not a Git repository" do
it "returns nil if `safe` parameter is `false`" do
expect(described_class.public... |
github | Homebrew/brew | https://github.com/Homebrew/brew | Library/Homebrew/test/utils/inreplace_spec.rb | Ruby | bsd-2-clause | 47,751 | main | 3,424 | # typed: false
# frozen_string_literal: true
require "tempfile"
require "utils/inreplace"
RSpec.describe Utils::Inreplace do
let(:file) { Tempfile.new("test") }
before do
File.binwrite(file, <<~EOS)
a
b
c
aa
EOS
end
after { file.unlink }
describe ".inreplace" do
it "ra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.