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/descriptions_spec.rb
Ruby
bsd-2-clause
47,751
main
3,258
# typed: false # frozen_string_literal: true require "descriptions" RSpec.describe Descriptions do subject(:descriptions) { described_class.new(descriptions_hash) } let(:descriptions_hash) { {} } it "can print description for a core Formula" do descriptions_hash["homebrew/core/foo"] = "Core foo" expec...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/pathname_spec.rb
Ruby
bsd-2-clause
47,751
main
8,719
# typed: false # frozen_string_literal: true require "extend/pathname" require "install_renamed" RSpec.describe Pathname do include FileUtils let(:src) { mktmpdir } let(:dst) { mktmpdir } let(:file) { src/"foo" } let(:dir) { src/"bar" } describe DiskUsageExtension do before do mkdir_p dir/"a-d...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/pkg_version_spec.rb
Ruby
bsd-2-clause
47,751
main
4,623
# typed: false # frozen_string_literal: true require "pkg_version" RSpec.describe PkgVersion do describe "::parse" do it "parses versions from a string" do expect(described_class.parse("1.0_1")).to eq(described_class.new(Version.new("1.0"), 1)) expect(described_class.parse("1.0_1")).to eq(described_...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/resource_spec.rb
Ruby
bsd-2-clause
47,751
main
6,213
# typed: false # frozen_string_literal: true require "resource" require "livecheck" RSpec.describe Resource do subject(:resource) { described_class.new("test") } let(:livecheck_resource) do described_class.new do url "https://brew.sh/foo-1.0.tar.gz" sha256 "0123456789abcdef0123456789abcdef0123456...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/formula_spec_selection_spec.rb
Ruby
bsd-2-clause
47,751
main
1,215
# typed: false # frozen_string_literal: true require "formula" RSpec.describe Formula do describe "::new" do it "selects stable by default" do f = formula do url "foo-1.0" head "foo" end expect(f).to be_stable end it "selects stable when exclusive" do f = formul...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/tab_spec.rb
Ruby
bsd-2-clause
47,751
main
22,574
# typed: false # frozen_string_literal: true require "tab" require "formula" RSpec.describe Tab do alias_matcher :be_built_with, :be_with matcher :be_poured_from_bottle do match do |actual| actual.poured_from_bottle == true end end matcher :be_built_as_bottle do match do |actual| act...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/exceptions_spec.rb
Ruby
bsd-2-clause
47,751
main
8,722
# typed: false # frozen_string_literal: true require "exceptions" RSpec.describe "Exception" do describe MultipleVersionsInstalledError do subject(:error) do described_class.new <<~EOS foo has multiple installed versions Run `brew uninstall --force foo` to remove all versions. EOS ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/deprecate_disable_spec.rb
Ruby
bsd-2-clause
47,751
main
10,146
# typed: false # frozen_string_literal: true require "deprecate_disable" RSpec.describe DeprecateDisable do let(:deprecate_date) { Date.parse("2020-01-01") } let(:disable_date) { deprecate_date >> DeprecateDisable::REMOVE_DISABLED_TIME_WINDOW } let(:deprecated_formula) do instance_double(Formula, deprecated...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/download_queue_spec.rb
Ruby
bsd-2-clause
47,751
main
1,259
# typed: false # frozen_string_literal: true require "download_queue" RSpec.describe Homebrew::DownloadQueue do subject(:download_queue) { described_class.new } let(:cached_download) { HOMEBREW_CACHE/"downloads/testball--0.1.tar.gz" } let(:downloadable) do instance_double( Downloadable, cached_...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/head_software_spec_spec.rb
Ruby
bsd-2-clause
47,751
main
382
# typed: false # frozen_string_literal: true require "head_software_spec" RSpec.describe HeadSoftwareSpec do subject(:head_spec) { described_class.new } specify "#version" do expect(head_spec.version).to eq(Version.new("HEAD")) end specify "#verify_download_integrity" do expect(head_spec.verify_down...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/test_runner_formula_spec.rb
Ruby
bsd-2-clause
47,751
main
16,931
# typed: false # frozen_string_literal: true require "test_runner_formula" require "test/support/fixtures/testball" RSpec.describe TestRunnerFormula do let(:testball) { Testball.new } let(:xcode_helper) { setup_test_runner_formula("xcode-helper", [:macos]) } let(:linux_kernel_requirer) { setup_test_runner_formu...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/formula_installer_spec.rb
Ruby
bsd-2-clause
47,751
main
27,072
# typed: false # frozen_string_literal: true require "formula" require "formula_installer" require "keg" require "sandbox" require "tab" require "cmd/install" require "test/support/fixtures/testball" require "test/support/fixtures/testball_bottle" require "test/support/fixtures/failball" require "test/support/fixtures...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/formula_validation_spec.rb
Ruby
bsd-2-clause
47,751
main
1,763
# typed: false # frozen_string_literal: true require "formula" RSpec.describe Formula do describe "::new" do matcher :fail_with_invalid do |attr| match do |actual| expect do actual.call rescue => e expect(e.attr).to eq(attr) raise e end.to raise_error(...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/homebrew_spec.rb
Ruby
bsd-2-clause
47,751
main
1,614
# typed: false # frozen_string_literal: true require "homebrew" # $times is the global used by inject_dump_stats! for recording method timings # rubocop:disable Style/GlobalVars RSpec.describe Homebrew do describe ".inject_dump_stats!" do before do $times = {} end after do $times = nil ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/formula_creator_spec.rb
Ruby
bsd-2-clause
47,751
main
3,224
# typed: false # frozen_string_literal: true require "formula_creator" RSpec.describe Homebrew::FormulaCreator do describe ".new" do tests = { "generic tarball URL": { url: "http://digit-labs.org/files/tools/synscan/releases/synscan-5.02.tar.gz", expected_name: ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/patching_spec.rb
Ruby
bsd-2-clause
47,751
main
6,701
# typed: false # frozen_string_literal: true require "formula" RSpec.describe "patching", type: :system do let(:formula_subclass) do Class.new(Formula) do # These are defined within an anonymous class to avoid polluting the global namespace. # rubocop:disable RSpec/LeakyConstantDeclaration,Lint/Cons...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/simulate_system_spec.rb
Ruby
bsd-2-clause
47,751
main
4,734
# typed: false # frozen_string_literal: true require "settings" RSpec.describe Homebrew::SimulateSystem do after do described_class.clear end describe "::simulating_or_running_on_macos?" do it "returns true on macOS", :needs_macos do described_class.clear expect(described_class.simulating_o...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/formatter_spec.rb
Ruby
bsd-2-clause
47,751
main
6,788
# typed: false # frozen_string_literal: true require "utils/formatter" require "utils/tty" RSpec.describe Formatter do describe "::columns" do subject(:columns) { described_class.columns(input) } let(:input) do %w[ aa bbb ccc dd ] end it "doesn't output ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/bottle_specification_spec.rb
Ruby
bsd-2-clause
47,751
main
2,109
# typed: false # frozen_string_literal: true require "bottle_specification" RSpec.describe BottleSpecification do subject(:bottle_spec) { described_class.new } describe "#sha256" do it "works without cellar" do checksums = { arm64_tahoe: "deadbeef" * 8, tahoe: "faceb00c" * 8, ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/caveats_spec.rb
Ruby
bsd-2-clause
47,751
main
9,568
# typed: false # frozen_string_literal: true require "formula" require "caveats" RSpec.describe Caveats do subject(:caveats) { described_class.new(f) } let(:f) { formula { url "foo-1.0" } } specify "#f" do expect(caveats.formula).to eq(f) end describe "#empty?" do it "returns true if the Formula ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/formula_auditor_spec.rb
Ruby
bsd-2-clause
47,751
main
63,514
# typed: false # frozen_string_literal: true require "formula_auditor" require "git_repository" require "securerandom" RSpec.describe Homebrew::FormulaAuditor do include FileUtils include Test::Helper::Formula let(:dir) { mktmpdir } let(:foo_version) do @count ||= 0 @count += 1 end let(:formula_s...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/github_runner_spec.rb
Ruby
bsd-2-clause
47,751
main
890
# typed: false # frozen_string_literal: true require "github_runner" RSpec.describe GitHubRunner do let(:runner) do spec = MacOSRunnerSpec.new(name: "macOS 11-arm64", runner: "11-arm64", timeout: 90, cleanup: true) version = MacOSVersion.new("11") described_class.new(platform: :macos, arch: :arm64, spec...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/github_runner_matrix_spec.rb
Ruby
bsd-2-clause
47,751
main
15,001
# typed: false # frozen_string_literal: true require "github_runner_matrix" require "test/support/fixtures/testball" RSpec.describe GitHubRunnerMatrix, :no_api do before do allow(ENV).to receive(:fetch).and_call_original allow(ENV).to receive(:fetch).with("HOMEBREW_LINUX_RUNNER").and_return("ubuntu-latest")...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/unlink_spec.rb
Ruby
bsd-2-clause
47,751
main
2,051
# typed: false # frozen_string_literal: true require "unlink" RSpec.describe Homebrew::Unlink do describe ".unlink_link_overwrite_formulae" do let(:formula) { instance_double(Formula, keg_only?: false) } let(:linked_keg_only_keg) { instance_double(Keg, directory?: true) } let(:linked_keg_only_formula) d...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/unpack_strategy_spec.rb
Ruby
bsd-2-clause
47,751
main
2,847
# typed: false # frozen_string_literal: true RSpec.describe UnpackStrategy do describe "#extract_nestedly" do subject(:strategy) { described_class.detect(path) } let(:unpack_dir) { mktmpdir } context "when extracting a GZIP nested in a BZIP2" do let(:file_name) { "file" } let(:path) do ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/error_during_execution_spec.rb
Ruby
bsd-2-clause
47,751
main
1,841
# typed: false # frozen_string_literal: true RSpec.describe ErrorDuringExecution do subject(:error) { described_class.new(command, status:, output:) } let(:command) { ["false"] } let(:status) { instance_double(Process::Status, exitstatus:, termsig: nil) } let(:exitstatus) { 1 } let(:output) { nil } descr...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/tap_auditor_spec.rb
Ruby
bsd-2-clause
47,751
main
9,338
# typed: false # frozen_string_literal: true require "tap_auditor" RSpec.describe Homebrew::TapAuditor do let(:tap) { Tap.fetch("homebrew", "foo") } let(:tap_path) { tap.path } let(:auditor) { described_class.new(tap, strict: false) } def write_cask(token, path = tap_path/"Casks"/"#{token}.rb") path.dirn...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask_dependent_spec.rb
Ruby
bsd-2-clause
47,751
main
1,538
# typed: false # frozen_string_literal: true require "cask/cask_loader" require "cask_dependent" RSpec.describe CaskDependent, :needs_macos do subject(:dependent) { described_class.new test_cask } let :test_cask do Cask::CaskLoader.load(+<<-RUBY) cask "testing" do depends_on formula: "baz" ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/missing_formula_spec.rb
Ruby
bsd-2-clause
47,751
main
6,091
# typed: false # frozen_string_literal: true require "missing_formula" RSpec.describe Homebrew::MissingFormula do describe "::reason" do subject { described_class.reason("gem") } it { is_expected.not_to be_nil } end describe "::disallowed_reason" do matcher :disallow do |name| match do |expe...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/sandbox_spec.rb
Ruby
bsd-2-clause
47,751
main
3,659
# typed: false # frozen_string_literal: true require "sandbox" RSpec.describe Sandbox, :needs_macos do define_negated_matcher :not_matching, :matching subject(:sandbox) { described_class.new } let(:dir) { mktmpdir } let(:file) { dir/"foo" } before do skip "Sandbox not implemented." unless described_c...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/tap_spec.rb
Ruby
bsd-2-clause
47,751
main
28,038
# typed: false # frozen_string_literal: true RSpec.describe Tap do include FileUtils alias_matcher :have_cask_file, :be_cask_file alias_matcher :have_formula_file, :be_formula_file alias_matcher :have_custom_remote, :be_custom_remote subject(:homebrew_foo_tap) { described_class.fetch("Homebrew", "foo") } ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/installed_dependents_spec.rb
Ruby
bsd-2-clause
47,751
main
8,709
# typed: false # frozen_string_literal: true require "installed_dependents" RSpec.describe InstalledDependents do include FileUtils def stub_formula(name, version = "1.0", &block) f = formula(name) do url "#{name}-#{version}" instance_eval(&block) if block end stub_formula_loader f s...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cleanup_spec.rb
Ruby
bsd-2-clause
47,751
main
17,505
# typed: false # frozen_string_literal: true require "test/support/fixtures/testball" require "cleanup" require "utils/autoremove" require "cask/cache" require "uninstall" require "fileutils" RSpec.describe Homebrew::Cleanup do subject(:cleanup) { described_class.new } let(:ds_store) { Pathname.new("#{HOMEBREW_C...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/service_spec.rb
Ruby
bsd-2-clause
47,751
main
40,720
# typed: false # frozen_string_literal: true require "formula" require "service" RSpec.describe Homebrew::Service do let(:name) { "formula_name" } def stub_formula(&block) formula(name) do url "https://brew.sh/test-1.0.tbz" instance_eval(&block) if block end end def stub_formula_with_se...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/keg_only_reason_spec.rb
Ruby
bsd-2-clause
47,751
main
461
# typed: false # frozen_string_literal: true require "keg_only_reason" RSpec.describe KegOnlyReason do describe "#to_s" do it "returns the reason provided" do r = described_class.new :provided_by_macos, "test" expect(r.to_s).to eq("test") end it "returns a default message when no reason is ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/messages_spec.rb
Ruby
bsd-2-clause
47,751
main
3,149
# typed: false # frozen_string_literal: true require "messages" require "spec_helper" RSpec.describe Messages do let(:messages) { described_class.new } let(:test_formula) { formula("foo") { url("https://brew.sh/foo-0.1.tgz") } } let(:elapsed_time) { 1.1 } describe "#record_caveats" do it "adds a caveat" ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/compiler_selector_spec.rb
Ruby
bsd-2-clause
47,751
main
3,813
# typed: false # frozen_string_literal: true require "compilers" require "software_spec" RSpec.describe CompilerSelector do subject(:selector) { described_class.new(software_spec, versions, compilers) } let(:compilers) { [:clang, :gnu] } let(:software_spec) { SoftwareSpec.new } let(:cc) { :clang } let(:ver...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/software_spec_spec.rb
Ruby
bsd-2-clause
47,751
main
9,270
# typed: false # frozen_string_literal: true require "software_spec" RSpec.describe SoftwareSpec do alias_matcher :have_defined_resource, :be_resource_defined alias_matcher :have_defined_option, :be_option_defined subject(:spec) { described_class.new } let(:owner) { instance_double(Cask::Cask, name: "some_n...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/sbom_spec.rb
Ruby
bsd-2-clause
47,751
main
2,937
# typed: false # frozen_string_literal: true require "sbom" RSpec.describe SBOM do describe "#schema_validation_errors" do subject(:sbom) { described_class.create(f, tab) } before { ENV.delete("HOMEBREW_ENFORCE_SBOM") } let(:f) { formula { url "foo-1.0" } } let(:tab) { Tab.new } it "returns t...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/macos_version_spec.rb
Ruby
bsd-2-clause
47,751
main
6,852
# typed: false # frozen_string_literal: true require "macos_version" RSpec.describe MacOSVersion do let(:version) { described_class.new("10.15") } let(:tahoe_major) { described_class.new("26.0") } let(:big_sur_major) { described_class.new("11.0") } let(:big_sur_update) { described_class.new("11.1") } let(:f...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/PATH_spec.rb
Ruby
bsd-2-clause
47,751
main
3,707
# typed: false # frozen_string_literal: true require "PATH" RSpec.describe PATH do describe "#initialize" do it "can take multiple arguments" do expect(described_class.new("/path1", "/path2")).to eq("/path1:/path2") end it "can parse a mix of arrays and arguments" do expect(described_class....
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/search_spec.rb
Ruby
bsd-2-clause
47,751
main
6,692
# typed: false # frozen_string_literal: true require "search" require "descriptions" require "cmd/desc" RSpec.describe Homebrew::Search do describe "#query_regexp" do it "correctly parses a regex query" do expect(described_class.query_regexp("/^query$/")).to eq(/^query$/) end it "returns the orig...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/system_command_spec.rb
Ruby
bsd-2-clause
47,751
main
11,423
# typed: false # frozen_string_literal: true require "system_command" RSpec.describe SystemCommand do describe "#initialize" do subject(:command) do described_class.new( "env", args: env_args, env:, must_succeed: true, sudo:, sudo_as_root:, ) ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/uninstall_spec.rb
Ruby
bsd-2-clause
47,751
main
1,723
# typed: false # frozen_string_literal: true require "uninstall" RSpec.describe Homebrew::Uninstall do let(:dependency) { formula("dependency") { url "f-1" } } let(:dependent_formula) do formula("dependent_formula") do url "f-1" depends_on "dependency" end end let(:dependent_cask) do ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cache_store_spec.rb
Ruby
bsd-2-clause
47,751
main
3,926
# typed: false # frozen_string_literal: true require "cache_store" RSpec.describe CacheStoreDatabase do subject(:sample_db) { described_class.new(:sample) } describe "self.use" do let(:type) { :test } it "creates a new `DatabaseCache` instance" do cache_store = instance_double(described_class, "ca...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/env_config_spec.rb
Ruby
bsd-2-clause
47,751
main
5,814
# typed: false # frozen_string_literal: true require "diagnostic" RSpec.describe Homebrew::EnvConfig do subject(:env_config) { described_class } describe "ENVS" do it "sorts alphabetically" do expect(env_config::ENVS.keys).to eql(env_config::ENVS.keys.sort) end end describe ".env_method_name" ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/formula_info_spec.rb
Ruby
bsd-2-clause
47,751
main
645
# typed: false # frozen_string_literal: true require "formula_info" RSpec.describe FormulaInfo, :integration_test do it "tests the FormulaInfo class" do formula_path = setup_test_formula "testball" info = described_class.lookup(formula_path) expect(info).not_to be_nil expect(info.revision).to eq(0) ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/version_spec.rb
Ruby
bsd-2-clause
47,751
main
38,050
# typed: false # frozen_string_literal: true require "version" RSpec.describe Version do subject(:version) { described_class.new("1.2.3") } specify ".formula_optionally_versioned_regex" do expect(described_class.formula_optionally_versioned_regex("foo")).to match("foo@1.2") end describe Version::Token d...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/lock_file_spec.rb
Ruby
bsd-2-clause
47,751
main
1,464
# typed: false # frozen_string_literal: true require "lock_file" RSpec.describe LockFile do subject(:lock_file) { described_class.new(:lock, Pathname("foo")) } let(:lock_file_copy) { described_class.new(:lock, Pathname("foo")) } describe "#lock" do it "ensures the lock file is created" do expect(loc...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dependency_collector_spec.rb
Ruby
bsd-2-clause
47,751
main
3,588
# 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 } def find_dependency(name) collector.deps.find { |dep| dep.name == name } end def find_requirem...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/formula_pin_spec.rb
Ruby
bsd-2-clause
47,751
main
1,125
# typed: false # frozen_string_literal: true require "formula_pin" RSpec.describe FormulaPin do subject(:formula_pin) { described_class.new(formula) } let(:name) { "double" } let(:formula) { instance_double(Formula, name:, rack: HOMEBREW_CELLAR/name) } before do formula.rack.mkpath allow(formula).t...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/build_environment_spec.rb
Ruby
bsd-2-clause
47,751
main
982
# typed: false # frozen_string_literal: true require "build_environment" RSpec.describe BuildEnvironment do let(:env) { described_class.new } describe "#<<" do it "returns itself" do expect(env << :foo).to be env end end describe "#merge" do it "returns itself" do expect(env.merge([]...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/ENV_spec.rb
Ruby
bsd-2-clause
47,751
main
5,566
# typed: false # frozen_string_literal: true require "extend/ENV" RSpec.describe "ENV" do shared_examples EnvActivation do subject(:env) { env_activation.extend(described_class) } let(:env_activation) { {}.extend(EnvActivation) } it "supports switching compilers" do subject.clang expect(su...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/spec_helper.rb
Ruby
bsd-2-clause
47,751
main
10,923
# typed: false # frozen_string_literal: true if ENV["HOMEBREW_TESTS_COVERAGE"] require "simplecov" require "simplecov-cobertura" formatters = [ SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::CoberturaFormatter, ] SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dependency_spec.rb
Ruby
bsd-2-clause
47,751
main
5,196
# typed: false # frozen_string_literal: true require "dependency" RSpec.describe Dependency do alias_matcher :be_a_build_dependency, :be_build describe "::new" do it "accepts a single tag" do dep = described_class.new("foo", %w[bar]) expect(dep.tags).to eq(%w[bar]) end it "accepts multip...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/quiet_progress_formatter.rb
Ruby
bsd-2-clause
47,751
main
322
# typed: true # frozen_string_literal: true require "rspec/core/formatters/progress_formatter" class QuietProgressFormatter < RSpec::Core::Formatters::ProgressFormatter RSpec::Core::Formatters.register self, :seed def dump_summary(notification); end def seed(notification); end def close(notification); end en...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/integration_mocks.rb
Ruby
bsd-2-clause
47,751
main
463
# typed: true # frozen_string_literal: true module Homebrew module Diagnostic class Checks def check_integration_test "This is an integration test" if ENV["HOMEBREW_INTEGRATION_TEST"] end end end def exec(*args) if ENV["HOMEBREW_TESTS_COVERAGE"] && ENV["HOMEBREW_INTEGRATION_TEST"...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/fixtures.rb
Ruby
bsd-2-clause
47,751
main
429
# typed: true # frozen_string_literal: true module Test module Helper module Fixtures def dylib_path(name) MachOPathname.wrap("#{TEST_FIXTURE_DIR}/mach/#{name}.dylib") end def bundle_path(name) MachOPathname.wrap("#{TEST_FIXTURE_DIR}/mach/#{name}.bundle") end def c...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/files.rb
Ruby
bsd-2-clause
47,751
main
401
# typed: true # frozen_string_literal: true module Test module Helper module Files def self.find_files return [] unless File.exist?(TEST_TMPDIR) Find.find(TEST_TMPDIR) .reject { |f| File.basename(f) == ".DS_Store" } .reject { |f| TEST_DIRECTORIES.include?(Pathname(f...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/cask.rb
Ruby
bsd-2-clause
47,751
main
462
# typed: false # frozen_string_literal: true require "cask/cask_loader" module Test module Helper module Cask def stub_cask_loader(cask, ref = cask.token, call_original: false) allow(::Cask::CaskLoader).to receive(:for).and_call_original if call_original loader = ::Cask::CaskLoader::FromI...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/formula.rb
Ruby
bsd-2-clause
47,751
main
903
# typed: false # frozen_string_literal: true require "formulary" module Test module Helper module Formula def formula(name = "formula_name", path: nil, spec: :stable, alias_path: nil, tap: nil, &block) path ||= Formulary.find_formula_in_tap(name, tap || CoreTap.instance) Class.new(::Formul...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/mktmpdir.rb
Ruby
bsd-2-clause
47,751
main
299
# typed: false # frozen_string_literal: true module Test module Helper module MkTmpDir def mktmpdir(prefix_suffix = nil) new_dir = Pathname.new(Dir.mktmpdir(prefix_suffix, HOMEBREW_TEMP)) return yield new_dir if block_given? new_dir end end end end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/cask/install_helper.rb
Ruby
bsd-2-clause
47,751
main
1,755
# typed: true # frozen_string_literal: true require "cask/installer" module InstallHelper module_function def self.install_without_artifacts(cask) Cask::Installer.new(cask).tap do |i| i.download i.extract_primary_container end end def self.install_without_artifacts_with_caskfile(cask) ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/cask/never_sudo_system_command.rb
Ruby
bsd-2-clause
47,751
main
231
# typed: true # frozen_string_literal: true require "system_command" class NeverSudoSystemCommand < SystemCommand def self.run(command, **options) super(command, **options.merge(sudo: false, sudo_as_root: false)) end end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb
Ruby
bsd-2-clause
47,751
main
449
# typed: false # frozen_string_literal: true RSpec.shared_examples "formulae exist" do |array| array.each do |f| it "#{f} formula exists", :needs_homebrew_core do core_tap = Pathname("#{HOMEBREW_LIBRARY_PATH}/../Taps/homebrew/homebrew-core") formula_paths = core_tap.glob("Formula/**/#{f}.rb") a...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/spec/shared_context/homebrew_cask.rb
Ruby
bsd-2-clause
47,751
main
2,992
# typed: false # frozen_string_literal: true require "cask/config" require "cask/cache" require "test/support/helper/cask/install_helper" require "test/support/helper/cask/never_sudo_system_command" module Cask class Config DEFAULT_DIRS_PATHNAMES = { appdir: Pathname(TEST_TMPDIR)/"cask-appd...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
Ruby
bsd-2-clause
47,751
main
8,867
# typed: false # frozen_string_literal: true require "open3" require "formula_installer" require "uninstall" RSpec::Matchers.define_negated_matcher :be_a_failure, :be_a_success # These shared contexts starting with `when` don't make sense. RSpec.shared_context "integration test" do # rubocop:disable RSpec/ContextWo...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/helper/cmd/brew-verify-undefined.rb
Ruby
bsd-2-clause
47,751
main
1,402
# typed: strict # frozen_string_literal: true require "cli/parser" require "utils/output" UNDEFINED_CONSTANTS = %w[ AbstractDownloadStrategy Addressable Base64 CacheStore Cask::Cask Cask::CaskLoader Completions CSV Formula Formulary GitRepository Homebrew::API Homebrew::Manpages Homebrew::...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/lib/startup/config.rb
Ruby
bsd-2-clause
47,751
main
2,769
# typed: true # frozen_string_literal: true raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!" unless ENV["HOMEBREW_BREW_FILE"] HOMEBREW_ORIGINAL_BREW_FILE = Pathname.new(ENV.fetch("HOMEBREW_ORIGINAL_BREW_FILE")).freeze HOMEBREW_BREW_FILE = Pathname.new(ENV.fetch("HOMEBREW_BREW_FILE")).freeze...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/support/extend/cachable.rb
Ruby
bsd-2-clause
47,751
main
1,917
# typed: true # frozen_string_literal: true raise "This needs to be required before Cachable gets loaded normally." if defined?(Cachable) # Collect all classes that mix in Cachable so that those caches can be cleared in-between tests. module Cachable private_class_method def self.included(klass) # It's difficul...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/livecheck_spec.rb
Ruby
bsd-2-clause
47,751
main
23,747
# typed: false # frozen_string_literal: true require "livecheck/livecheck" RSpec.describe Homebrew::Livecheck do subject(:livecheck) { described_class } let(:cask_url) { "https://brew.sh/test-0.0.1.dmg" } let(:head_url) { "https://github.com/Homebrew/brew.git" } let(:homepage_url) { "https://brew.sh" } let...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/skip_conditions_spec.rb
Ruby
bsd-2-clause
47,751
main
26,254
# typed: false # frozen_string_literal: true require "livecheck/livecheck" require "livecheck/skip_conditions" RSpec.describe Homebrew::Livecheck::SkipConditions do subject(:skip_conditions) { described_class } let(:formulae) do { basic: formula("test") do desc "Test formula" ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/livecheck_version_spec.rb
Ruby
bsd-2-clause
47,751
main
1,766
# typed: false # frozen_string_literal: true require "livecheck/livecheck_version" RSpec.describe Homebrew::Livecheck::LivecheckVersion do let(:formula) { instance_double(Formula) } let(:cask) { instance_double(Cask::Cask) } let(:resource) { instance_double(Resource) } before do # Case statements use #==...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy_spec.rb
Ruby
bsd-2-clause
47,751
main
15,074
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy do subject(:strategy) { described_class } let(:url) { "https://brew.sh/" } let(:redirection_url) { "https://brew.sh/redirection" } let(:post_hash) do { empty: "", boolean:...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/options_spec.rb
Ruby
bsd-2-clause
47,751
main
4,657
# typed: false # frozen_string_literal: true require "livecheck/options" RSpec.describe Homebrew::Livecheck::Options do subject(:options) { described_class } let(:cookies) { { "cookie_key" => "cookie_value" } } let(:header_string) { "Accept: */*" } let(:referer_url) { "https://example.com/referer" } let(:p...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/apache_spec.rb
Ruby
bsd-2-clause
47,751
main
9,329
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Apache do subject(:apache) { described_class } let(:apache_urls) do { version_dir: "https://www.apache.org/dyn/closer.lua?path=abc/1.2.3/def-1.2.3.tar.gz", ve...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/github_releases_spec.rb
Ruby
bsd-2-clause
47,751
main
7,297
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::GithubReleases do subject(:github_releases) { described_class } let(:github_urls) do { release_asset: "https://github.com/abc/def/releases/download/1.2.3/ghi-1.2.3.tar.gz", ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/sourceforge_spec.rb
Ruby
bsd-2-clause
47,751
main
5,005
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Sourceforge do subject(:sourceforge) { described_class } let(:sourceforge_urls) do { typical: "https://downloads.sourceforge.net/project/abc/def-1.2.3.tar.gz", rss: ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/gnome_spec.rb
Ruby
bsd-2-clause
47,751
main
3,521
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Gnome do subject(:gnome) { described_class } let(:gnome_url) { "https://download.gnome.org/sources/abc/1.2/abc-1.2.3.tar.xz" } let(:non_gnome_url) { "https://brew.sh/test" } let(:generated...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/cpan_spec.rb
Ruby
bsd-2-clause
47,751
main
4,930
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Cpan do subject(:cpan) { described_class } let(:cpan_urls) do { no_subdirectory: "https://cpan.metacpan.org/authors/id/H/HO/HOMEBREW/Brew-v1.2.3.tar.gz", with_subdirectory...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/sparkle_spec.rb
Ruby
bsd-2-clause
47,751
main
20,793
# typed: false # frozen_string_literal: true require "livecheck/strategy" require "bundle_version" RSpec.describe Homebrew::Livecheck::Strategy::Sparkle do subject(:sparkle) { described_class } def create_appcast_xml(items_str = "") <<~EOS <?xml version="1.0" encoding="utf-8"?> <rss version="2.0"...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/extract_plist_spec.rb
Ruby
bsd-2-clause
47,751
main
7,936
# typed: false # frozen_string_literal: true require "livecheck/strategy" require "bundle_version" RSpec.describe Homebrew::Livecheck::Strategy::ExtractPlist do subject(:extract_plist) { described_class } let(:http_url) { "https://brew.sh/blog/" } let(:non_http_url) { "ftp://brew.sh/" } let(:items) do {...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/page_match_spec.rb
Ruby
bsd-2-clause
47,751
main
6,124
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::PageMatch do subject(:page_match) { described_class } let(:http_url) { "https://brew.sh/blog/" } let(:non_http_url) { "ftp://brew.sh/" } let(:regex) { %r{href=.*?/homebrew[._-]v?(\d+(?:\.\...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/json_spec.rb
Ruby
bsd-2-clause
47,751
main
5,503
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Json do subject(:json) { described_class } let(:http_url) { "https://brew.sh/blog/" } let(:non_http_url) { "ftp://brew.sh/" } let(:regex) { /^v?(\d+(?:\.\d+)+)$/i } let(:content) do ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/electron_builder_spec.rb
Ruby
bsd-2-clause
47,751
main
3,667
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::ElectronBuilder do subject(:electron_builder) { described_class } let(:http_url) { "https://www.example.com/example/latest-mac.yml" } let(:non_http_url) { "ftp://brew.sh/" } let(:regex) { ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/github_latest_spec.rb
Ruby
bsd-2-clause
47,751
main
4,824
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::GithubLatest do subject(:github_latest) { described_class } let(:github_urls) do { release_asset: "https://github.com/abc/def/releases/download/1.2.3/ghi-1.2.3.tar.gz", shor...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/launchpad_spec.rb
Ruby
bsd-2-clause
47,751
main
3,760
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Launchpad do subject(:launchpad) { described_class } let(:launchpad_urls) do { version_dir: "https://launchpad.net/abc/1.2/1.2.3/+download/abc-1.2.3.tar.gz", trunk: ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/xorg_spec.rb
Ruby
bsd-2-clause
47,751
main
7,316
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Xorg do subject(:xorg) { described_class } let(:xorg_urls) do { app: "https://www.x.org/archive/individual/app/abc-1.2.3.tar.bz2", font: "https://www.x.org/archiv...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/npm_spec.rb
Ruby
bsd-2-clause
47,751
main
3,320
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Npm do subject(:npm) { described_class } let(:npm_urls) do { typical: "https://registry.npmjs.org/abc/-/def-1.2.3.tgz", org_scoped: "https://registry.npmjs.org/@example/abc/-...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/git_spec.rb
Ruby
bsd-2-clause
47,751
main
13,548
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Git do subject(:git) { described_class } let(:git_url) { "https://github.com/Homebrew/brew.git" } let(:non_git_url) { "https://brew.sh/test" } let(:regexes) do { standard: /^v?(\...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/xml_spec.rb
Ruby
bsd-2-clause
47,751
main
9,332
# typed: false # frozen_string_literal: true require "livecheck/strategy" require "rexml/document" require "rexml/undefinednamespaceexception" RSpec.describe Homebrew::Livecheck::Strategy::Xml do subject(:xml) { described_class } let(:http_url) { "https://brew.sh/blog/" } let(:non_http_url) { "ftp://brew.sh/" ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/bitbucket_spec.rb
Ruby
bsd-2-clause
47,751
main
4,638
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Bitbucket do subject(:bitbucket) { described_class } let(:bitbucket_urls) do { get: "https://bitbucket.org/abc/def/get/1.2.3.tar.gz", downloads: "https://bitbucket.org/abc...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/header_match_spec.rb
Ruby
bsd-2-clause
47,751
main
6,477
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::HeaderMatch do subject(:header_match) { described_class } let(:http_url) { "https://brew.sh/blog/" } let(:non_http_url) { "ftp://brew.sh/" } let(:regexes) do { archive: /filename...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/gnu_spec.rb
Ruby
bsd-2-clause
47,751
main
5,792
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Gnu do subject(:gnu) { described_class } let(:gnu_urls) do { no_version_dir: "https://ftpmirror.gnu.org/gnu/abc/abc-1.2.3.tar.gz", software_page: "https://www.gnu.org/software/...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/hackage_spec.rb
Ruby
bsd-2-clause
47,751
main
3,220
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Hackage do subject(:hackage) { described_class } let(:hackage_urls) do { package: "https://hackage.haskell.org/package/abc-1.2.3/abc-1.2.3.tar.gz", downloads: "https://downloa...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/pypi_spec.rb
Ruby
bsd-2-clause
47,751
main
3,969
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Pypi do subject(:pypi) { described_class } let(:pypi_url) { "https://files.pythonhosted.org/packages/ab/cd/efg/example-package-1.2.3.tar.gz" } let(:non_pypi_url) { "https://brew.sh/test" } ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/crate_spec.rb
Ruby
bsd-2-clause
47,751
main
5,089
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Crate do subject(:crate) { described_class } let(:crate_url) { "https://static.crates.io/crates/example/example-0.1.0.crate" } let(:non_crate_url) { "https://brew.sh/test" } # This only di...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/livecheck/strategy/yaml_spec.rb
Ruby
bsd-2-clause
47,751
main
5,726
# typed: false # frozen_string_literal: true require "livecheck/strategy" RSpec.describe Homebrew::Livecheck::Strategy::Yaml do subject(:yaml) { described_class } let(:http_url) { "https://brew.sh/blog/" } let(:non_http_url) { "ftp://brew.sh/" } let(:regex) { /^v?(\d+(?:\.\d+)+)$/i } let(:content) do ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cmd/fetch_spec.rb
Ruby
bsd-2-clause
47,751
main
965
# typed: false # frozen_string_literal: true require "cmd/fetch" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::Cmd::FetchCmd do it_behaves_like "parseable arguments" it "downloads the Formula's URL", :integration_test do setup_test_formula "testball" expect { brew "fetch", "testball"...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cmd/setup-ruby_spec.rb
Ruby
bsd-2-clause
47,751
main
302
# typed: false # frozen_string_literal: true RSpec.describe "brew setup-ruby", type: :system do it "installs and configures Homebrew's Ruby", :integration_test do expect { brew_sh "setup-ruby" } .to output("").to_stdout .and not_to_output.to_stderr .and be_a_success end end