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/cask/config_spec.rb
Ruby
bsd-2-clause
47,751
main
2,955
# typed: false # frozen_string_literal: true RSpec.describe Cask::Config, :cask do subject(:config) { described_class.new } describe "::from_json" do it "deserializes a configuration in JSON format" do config = described_class.from_json <<~EOS { "default": { "appdir": "/pat...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/cask_loader_spec.rb
Ruby
bsd-2-clause
47,751
main
15,468
# typed: false # frozen_string_literal: true RSpec.describe Cask::CaskLoader, :cask do describe "::for" do let(:tap) { CoreCaskTap.instance } context "when a cask is renamed" do let(:old_token) { "version-newest" } let(:new_token) { "version-latest" } let(:api_casks) do [old_token...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/audit_spec.rb
Ruby
bsd-2-clause
47,751
main
41,529
# typed: false # frozen_string_literal: true require "cask/audit" RSpec.describe Cask::Audit, :cask do def include_msg?(problems, msg) if msg.is_a?(Regexp) Array(problems).any? { |problem| msg.match?(problem[:message]) } else Array(problems).any? { |problem| problem[:message] == msg } end ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/reinstall_spec.rb
Ruby
bsd-2-clause
47,751
main
3,396
# typed: false # frozen_string_literal: true require "cask/installer" require "cask/reinstall" RSpec.describe Cask::Reinstall, :cask do it "displays the reinstallation progress" do caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) Cask::Installer.new(caffeine).install output = Regexp.new <...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/utils_spec.rb
Ruby
bsd-2-clause
47,751
main
2,262
# typed: false # frozen_string_literal: true RSpec.describe Cask::Utils do let(:command) { NeverSudoSystemCommand } let(:dir) { mktmpdir } let(:path) { dir/"a/b/c" } let(:link) { dir/"link" } describe "::gain_permissions_mkpath" do it "creates a directory" do expect(path).not_to exist descri...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/depends_on_spec.rb
Ruby
bsd-2-clause
47,751
main
2,359
# typed: false # frozen_string_literal: true # TODO: this test should be named after the corresponding class, once # that class is abstracted from installer.rb # rubocop:disable RSpec/DescribeClass RSpec.describe "Satisfy Dependencies and Requirements", :cask do # rubocop:enable RSpec/DescribeClass subject(:...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/tab_spec.rb
Ruby
bsd-2-clause
47,751
main
13,264
# typed: false # frozen_string_literal: true require "cask" RSpec.describe Cask::Tab, :cask do matcher :be_installed_as_dependency do match do |actual| actual.installed_as_dependency == true end end matcher :be_installed_on_request do match do |actual| actual.installed_on_request == tru...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/denylist_spec.rb
Ruby
bsd-2-clause
47,751
main
986
# typed: false # frozen_string_literal: true require "cask/denylist" RSpec.describe Cask::Denylist, :cask do describe "::reason" do matcher :disallow do |name| match do |expected| expected.reason(name) end end specify(:aggregate_failures) do expect(subject).not_to disallow("ad...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/macos_spec.rb
Ruby
bsd-2-clause
47,751
main
1,936
# typed: false # frozen_string_literal: true RSpec.describe MacOS, :cask do it "says '/' is undeletable" do expect(described_class).to be_undeletable( "/", ) expect(described_class).to be_undeletable( "/.", ) expect(described_class).to be_undeletable( "/usr/local/Library/Taps/.....
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/upgrade_spec.rb
Ruby
bsd-2-clause
47,751
main
24,868
# typed: false # frozen_string_literal: true require "cask/upgrade" RSpec.describe Cask::Upgrade, :cask do def write_info_plist(path, short_version:, bundle_version:) info_plist = path/"Contents/Info.plist" info_plist.dirname.mkpath info_plist.write <<~PLIST <?xml version="1.0" encoding="UTF-8"?> ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/download_spec.rb
Ruby
bsd-2-clause
47,751
main
4,176
# typed: false # frozen_string_literal: true RSpec.describe Cask::Download, :cask do describe "#download_name" do subject(:download_name) { described_class.new(cask).send(:download_name) } let(:download) { described_class.new(cask) } let(:token) { "example-cask" } let(:full_token) { token } let(...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/preflight_block_spec.rb
Ruby
bsd-2-clause
47,751
main
1,254
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::PreflightBlock, :cask do describe "install_phase" do it "calls the specified block before installing, passing a Cask mini-dsl" do called = false yielded_arg = nil cask = Cask::Cask.new("with-preflight") do pref...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/relocated_spec.rb
Ruby
bsd-2-clause
47,751
main
1,787
# typed: false # frozen_string_literal: true require "cask/artifact/relocated" RSpec.describe Cask::Artifact::Relocated, :cask do let(:cask) do Cask::Cask.new("test-cask") do url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage "https://brew.sh/" version "1.0" sha256 "67cdb8a02803...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb
Ruby
bsd-2-clause
47,751
main
451
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::Zap, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-installable")) } let(:zap_artifact) do cask.artifacts.find { |a| a.is_a?(described_class) } end before do InstallHelper.install_without_artifacts(cask) end ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/pkg_spec.rb
Ruby
bsd-2-clause
47,751
main
2,586
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::Pkg, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-installable")) } let(:fake_system_command) { class_double(SystemCommand) } before do InstallHelper.install_without_artifacts(cask) end describe "install_phase" do...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/abstract_uninstall_spec.rb
Ruby
bsd-2-clause
47,751
main
3,685
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::AbstractUninstall, :cask do [ [Cask::Artifact::Uninstall, :uninstall], [Cask::Artifact::Zap, :zap], ].each do |artifact_class, artifact_dsl_key| describe "#each_resolved_path for #{artifact_dsl_key.inspect}" do subject(:a...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/uninstall_spec.rb
Ruby
bsd-2-clause
47,751
main
7,231
# typed: false # frozen_string_literal: true require_relative "shared_examples/uninstall_zap" RSpec.describe Cask::Artifact::Uninstall, :cask do describe "#uninstall_phase" do let(:fake_system_command) { NeverSudoSystemCommand } include_examples "#uninstall_phase or #zap_phase" describe "upgrade/reins...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/abstract_artifact_spec.rb
Ruby
bsd-2-clause
47,751
main
823
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::AbstractArtifact, :cask do describe ".read_script_arguments" do let(:stanza) { :installer } it "accepts a string and uses it as the executable" do arguments = "something" expect(described_class.read_script_arguments(arg...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/installer_spec.rb
Ruby
bsd-2-clause
47,751
main
1,236
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::Installer, :cask do subject(:installer) { described_class.new(cask, **args) } let(:staged_path) { mktmpdir } let(:cask) { instance_double(Cask::Cask, staged_path:) } let(:command) { SystemCommand } let(:args) { {} } describe "#...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb
Ruby
bsd-2-clause
47,751
main
1,704
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::Artifact, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-generic-artifact")) } let(:install_phase) do lambda do cask.artifacts.grep(described_class).each do |artifact| artifact.install_phase(command: NeverSu...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/bashcompletion_spec.rb
Ruby
bsd-2-clause
47,751
main
1,286
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::BashCompletion, :cask do let(:cask) { Cask::CaskLoader.load(cask_token) } context "with install" do let(:install_phase) do lambda do cask.artifacts.grep(described_class).each do |artifact| artifact.install_phas...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/zap_spec.rb
Ruby
bsd-2-clause
47,751
main
1,147
# typed: false # frozen_string_literal: true require_relative "shared_examples/uninstall_zap" RSpec.describe Cask::Artifact::Zap, :cask do describe "#zap_phase" do include_examples "#uninstall_phase or #zap_phase" context "when using :rmdir" do subject(:artifact) { cask.artifacts.find { |a| a.is_a?(d...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/zshcompletion_spec.rb
Ruby
bsd-2-clause
47,751
main
1,280
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::ZshCompletion, :cask do let(:cask) { Cask::CaskLoader.load(cask_token) } context "with install" do let(:install_phase) do lambda do cask.artifacts.grep(described_class).each do |artifact| artifact.install_phase...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/symlinked_spec.rb
Ruby
bsd-2-clause
47,751
main
2,154
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::Symlinked, :cask do # Test the formula conflict detection functionality that applies to all symlinked artifacts describe "#conflicting_formula" do let(:cask) do Cask::CaskLoader.load(cask_path("with-binary")).tap do |cask| ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/manpage_spec.rb
Ruby
bsd-2-clause
47,751
main
1,346
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::Manpage, :cask do let(:cask) { Cask::CaskLoader.load(cask_token) } context "without section" do let(:cask_token) { "invalid-manpage-no-section" } it "fails to load a cask without section", :no_api do expect { cask }.to rais...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/postflight_block_spec.rb
Ruby
bsd-2-clause
47,751
main
1,261
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::PostflightBlock, :cask do describe "install_phase" do it "calls the specified block after installing, passing a Cask mini-dsl" do called = false yielded_arg = nil cask = Cask::Cask.new("with-postflight") do pos...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/app_spec.rb
Ruby
bsd-2-clause
47,751
main
13,203
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::App, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("local-caffeine")) } let(:command) { NeverSudoSystemCommand } let(:adopt) { false } let(:force) { false } let(:auto_updates) { false } let(:app) { cask.artifacts.find { |a|...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/fishlcompletion_spec.rb
Ruby
bsd-2-clause
47,751
main
1,296
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::FishCompletion, :cask do let(:cask) { Cask::CaskLoader.load(cask_token) } context "with install" do let(:install_phase) do lambda do cask.artifacts.grep(described_class).each do |artifact| artifact.install_phas...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/generated_completion_spec.rb
Ruby
bsd-2-clause
47,751
main
3,567
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::GeneratedCompletion, :cask do let(:staged_path) { Pathname(Dir.mktmpdir) } let(:cask) do tmp_staged = staged_path Cask::Cask.new("test-generated-completion") do version "1.0" sha256 :no_check url "file:///dev/nul...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/alt_target_spec.rb
Ruby
bsd-2-clause
47,751
main
2,464
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::App, :cask do describe "activate to alternate target" do let(:cask) { Cask::CaskLoader.load(cask_path("with-alt-target")) } let(:install_phase) do cask.artifacts.grep(described_class).each do |artifact| artifact.instal...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/suite_spec.rb
Ruby
bsd-2-clause
47,751
main
1,017
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::Suite, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("with-suite")) } let(:install_phase) do lambda do cask.artifacts.grep(described_class).each do |artifact| artifact.install_phase(command: NeverSudoSystemComman...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/binary_spec.rb
Ruby
bsd-2-clause
47,751
main
3,394
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::Binary, :cask do let(:cask) do Cask::CaskLoader.load(cask_path("with-binary")).tap do |cask| InstallHelper.install_without_artifacts(cask) end end let(:artifacts) { cask.artifacts.grep(described_class) } let(:binarydir) {...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb
Ruby
bsd-2-clause
47,751
main
3,255
# typed: false # frozen_string_literal: true RSpec.describe Cask::Artifact::App, :cask do describe "multiple apps" do let(:cask) { Cask::CaskLoader.load(cask_path("with-two-apps-correct")) } let(:install_phase) do cask.artifacts.grep(described_class).each do |artifact| artifact.install_phase(c...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/artifact/shared_examples/uninstall_zap.rb
Ruby
bsd-2-clause
47,751
main
15,613
# typed: false # frozen_string_literal: true require "benchmark" RSpec.shared_examples "#uninstall_phase or #zap_phase" do subject { artifact } let(:artifact_dsl_key) { described_class.dsl_key } let(:artifact) { cask.artifacts.find { |a| a.is_a?(described_class) } } let(:fake_system_command) { class_double(S...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/cask_loader/from_api_loader_spec.rb
Ruby
bsd-2-clause
47,751
main
9,733
# typed: false # frozen_string_literal: true RSpec.describe Cask::CaskLoader::FromAPILoader, :cask do shared_context "with API setup" do |local_token| let(:api_token) { "#{local_token}-api" } let(:cask_from_source) { Cask::CaskLoader.load(local_token) } let(:cask_json) do hash = cask_from_source.to...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/cask_loader/from_content_loader_spec.rb
Ruby
bsd-2-clause
47,751
main
1,655
# typed: false # frozen_string_literal: true RSpec.describe Cask::CaskLoader::FromContentLoader do describe "::try_new" do it "returns a loader for Casks specified with `cask \"token\" do … end`" do expect(described_class.try_new(<<~RUBY)).not_to be_nil cask "token" do end RUBY en...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/cask_loader/from_uri_loader_spec.rb
Ruby
bsd-2-clause
47,751
main
1,841
# typed: false # frozen_string_literal: true RSpec.describe Cask::CaskLoader::FromURILoader do describe "::try_new" do it "returns a loader when given an URI" do expect(described_class.try_new(URI("https://brew.sh/"))).not_to be_nil end it "returns a loader when given a string which can be parsed ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/cask_loader/from_tap_loader_spec.rb
Ruby
bsd-2-clause
47,751
main
1,042
# typed: false # frozen_string_literal: true RSpec.describe Cask::CaskLoader::FromTapLoader do let(:tap) { CoreCaskTap.instance } let(:cask_name) { "testball" } let(:cask_full_name) { "homebrew/cask/#{cask_name}" } let(:cask_path) { tap.cask_dir/"#{cask_name}.rb" } describe "#load" do before do ca...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/cask_loader/from_path_loader_spec.rb
Ruby
bsd-2-clause
47,751
main
2,213
# typed: false # frozen_string_literal: true RSpec.describe Cask::CaskLoader::FromPathLoader do describe "#load" do context "when the file does not contain a cask" do let(:path) do (mktmpdir/"cask.rb").tap do |path| path.write <<~RUBY true RUBY end end ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/utils/trash_spec.rb
Ruby
bsd-2-clause
47,751
main
2,243
# typed: false # frozen_string_literal: true require "cask/utils/trash" RSpec.describe Cask::Utils::Trash do describe "::trash" do let(:path) { Pathname("/tmp/example") } it "uses the Swift trash implementation on macOS" do expect(described_class).to receive(:swift_trash) .with(path, command:...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/container_spec.rb
Ruby
bsd-2-clause
47,751
main
861
# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" RSpec.describe Cask::DSL::Container do subject(:container) { described_class.new(**params) } describe "#pairs" do let(:params) { { nested: "NestedApp.dmg" } } it "returns the attributes as a hash" do expect(c...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/version_spec.rb
Ruby
bsd-2-clause
47,751
main
10,159
# typed: false # frozen_string_literal: true RSpec.describe Cask::DSL::Version, :cask do shared_examples "expectations hash" do |input_name, expectations| expectations.each do |input_value, expected_output| context "when #{input_name} is #{input_value.inspect}" do let(input_name.to_sym) { input_val...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/rename_spec.rb
Ruby
bsd-2-clause
47,751
main
3,268
# typed: false # frozen_string_literal: true RSpec.describe Cask::DSL::Rename do subject(:rename) { described_class.new(from, to) } let(:from) { "Source File*.pkg" } let(:to) { "Target File.pkg" } describe "#initialize" do it "sets the from and to attributes" do expect(rename.from).to eq("Source Fi...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/uninstall_preflight_spec.rb
Ruby
bsd-2-clause
47,751
main
486
# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" require "test/cask/dsl/shared_examples/staged" RSpec.describe Cask::DSL::UninstallPreflight, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } let(:fake_system_command) { class_double(SystemCommand) } ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/postflight_spec.rb
Ruby
bsd-2-clause
47,751
main
478
# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" require "test/cask/dsl/shared_examples/staged" RSpec.describe Cask::DSL::Postflight, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } let(:fake_system_command) { class_double(SystemCommand) } let(:dsl...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/uninstall_postflight_spec.rb
Ruby
bsd-2-clause
47,751
main
322
# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" RSpec.describe Cask::DSL::UninstallPostflight, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } let(:dsl) { described_class.new(cask, class_double(SystemCommand)) } it_behaves_like Cask::DSL::Base en...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/caveats_spec.rb
Ruby
bsd-2-clause
47,751
main
2,569
# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" RSpec.describe Cask::DSL::Caveats, :cask do subject(:caveats) { described_class.new(cask) } let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } let(:dsl) { caveats } it_behaves_like Cask::DSL::Base describ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/preflight_spec.rb
Ruby
bsd-2-clause
47,751
main
477
# typed: false # frozen_string_literal: true require "test/cask/dsl/shared_examples/base" require "test/cask/dsl/shared_examples/staged" RSpec.describe Cask::DSL::Preflight, :cask do let(:cask) { Cask::CaskLoader.load(cask_path("basic-cask")) } let(:fake_system_command) { class_double(SystemCommand) } let(:dsl)...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/shared_examples/base.rb
Ruby
bsd-2-clause
47,751
main
581
# typed: false # frozen_string_literal: true require "cask/dsl/base" RSpec.shared_examples Cask::DSL::Base do it "supports the token method" do expect(dsl.token).to eq(cask.token) end it "supports the version method" do expect(dsl.version).to eq(cask.version) end it "supports the caskroom_path met...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/cask/dsl/shared_examples/staged.rb
Ruby
bsd-2-clause
47,751
main
3,373
# typed: false # frozen_string_literal: true require "cask/staged" RSpec.shared_examples Cask::Staged do let(:existing_path) { Pathname("/path/to/file/that/exists") } let(:non_existent_path) { Pathname("/path/to/file/that/does/not/exist") } before do allow(existing_path).to receive_messages(exist?: true, e...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/api/formula_struct_spec.rb
Ruby
bsd-2-clause
47,751
main
10,432
# typed: false # frozen_string_literal: true require "api" RSpec.describe Homebrew::API::FormulaStruct do describe "#serialize_bottle" do def build_formula_struct(checksums) Homebrew::API::FormulaStruct.new( desc: "sample formula", homepage: "https://example.com...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/api/formula_spec.rb
Ruby
bsd-2-clause
47,751
main
4,550
# typed: false # frozen_string_literal: true require "api" require "test/support/fixtures/testball" RSpec.describe Homebrew::API::Formula do let(:cache_dir) { mktmpdir } before do stub_const("Homebrew::API::HOMEBREW_CACHE_API", cache_dir) end def mock_curl_download(stdout:) allow(Utils::Curl).to rec...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/api/cask_struct_spec.rb
Ruby
bsd-2-clause
47,751
main
9,189
# typed: false # frozen_string_literal: true require "api" RSpec.describe Homebrew::API::CaskStruct do describe "::from_hash" do it "constructs a valid struct from a hash with all field types" do hash = { "sha256" => "abc123", "version" => "1.0.0", "ruby_...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/api/cask_spec.rb
Ruby
bsd-2-clause
47,751
main
2,128
# typed: false # frozen_string_literal: true require "api" RSpec.describe Homebrew::API::Cask do let(:cache_dir) { mktmpdir } before do stub_const("Homebrew::API::HOMEBREW_CACHE_API", cache_dir) end def mock_curl_download(stdout:) allow(Utils::Curl).to receive(:curl_download) do |*_args, **kwargs| ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/api/internal_spec.rb
Ruby
bsd-2-clause
47,751
main
8,038
# typed: false # frozen_string_literal: true require "api/internal" RSpec.describe Homebrew::API::Internal do let(:cache_dir) { mktmpdir } let(:packages_json) do <<~JSON { "formulae": { "foo": { "desc": "Foo formula", "homepage": "https://example.com/foo", ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/api/formula/formula_struct_generator_spec.rb
Ruby
bsd-2-clause
47,751
main
4,851
# typed: false # frozen_string_literal: true require "api" RSpec.describe Homebrew::API::Formula::FormulaStructGenerator do let(:raw_dependency_hash) do { "dependencies" => [ "foo", { "bar" => "build" }, { "baz" => ["build", "test"] }, ], "uses_from_macos" ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/api/cask/cask_struct_generator_spec.rb
Ruby
bsd-2-clause
47,751
main
1,766
# typed: false # frozen_string_literal: true require "api" RSpec.describe Homebrew::API::Cask::CaskStructGenerator do describe ":process_depends_on" do let(:depends_on_non_macos) do { arch: [{ type: :intel, bits: 64 }], formula: ["foo"], } end let(:depends_on_macos_equals)...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/edit_spec.rb
Ruby
bsd-2-clause
47,751
main
1,500
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/edit" RSpec.describe Homebrew::DevCmd::Edit do it_behaves_like "parseable arguments" it "opens a given Formula in an editor", :integration_test do HOMEBREW_REPOSITORY.cd do system "git", "init" en...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/linkage_spec.rb
Ruby
bsd-2-clause
47,751
main
794
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/linkage" RSpec.describe Homebrew::DevCmd::Linkage do it_behaves_like "parseable arguments" it "works when no arguments are provided", :integration_test do setup_test_formula "testball" (HOMEBREW_CELLAR/...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/livecheck_spec.rb
Ruby
bsd-2-clause
47,751
main
997
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/livecheck" RSpec.describe Homebrew::DevCmd::LivecheckCmd do it_behaves_like "parseable arguments" it "reports the latest version of a Formula", :integration_test, :needs_network do content = <<~RUBY d...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/generate-zap_spec.rb
Ruby
bsd-2-clause
47,751
main
8,203
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/generate-zap" RSpec.describe Homebrew::DevCmd::GenerateZap do subject(:generate_zap) { described_class.new(["test"]) } it_behaves_like "parseable arguments" describe "#resolve_app_name_from_cask" do it "...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/bump-cask-pr_spec.rb
Ruby
bsd-2-clause
47,751
main
13,435
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/bump-cask-pr" require "bump_version_parser" RSpec.describe Homebrew::DevCmd::BumpCaskPr do subject(:bump_cask_pr) { described_class.new(["test"]) } let(:newest_macos) { MacOSVersion.new(HOMEBREW_MACOS_NEWEST_SU...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/generate-formula-api_spec.rb
Ruby
bsd-2-clause
47,751
main
227
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/generate-formula-api" RSpec.describe Homebrew::DevCmd::GenerateFormulaApi do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/generate-analytics-api_spec.rb
Ruby
bsd-2-clause
47,751
main
231
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/generate-analytics-api" RSpec.describe Homebrew::DevCmd::GenerateAnalyticsApi do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/extract_spec.rb
Ruby
bsd-2-clause
47,751
main
2,340
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/extract" RSpec.describe Homebrew::DevCmd::Extract do it_behaves_like "parseable arguments" context "when extracting a formula" do let!(:target) do path = HOMEBREW_TAP_DIRECTORY/"homebrew/homebrew-foo"...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/typecheck_spec.rb
Ruby
bsd-2-clause
47,751
main
1,149
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/typecheck" RSpec.describe Homebrew::DevCmd::Typecheck do it_behaves_like "parseable arguments" describe "#trim_rubocop_rbi" do let(:rbi_file) { Pathname.new("#{TEST_FIXTURE_DIR}/rubocop@x.x.x.rbi") } le...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/install-bundler-gems_spec.rb
Ruby
bsd-2-clause
47,751
main
227
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/install-bundler-gems" RSpec.describe Homebrew::DevCmd::InstallBundlerGems do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/pr-upload_spec.rb
Ruby
bsd-2-clause
47,751
main
206
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/pr-upload" RSpec.describe Homebrew::DevCmd::PrUpload do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/vendor-gems_spec.rb
Ruby
bsd-2-clause
47,751
main
210
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/vendor-gems" RSpec.describe Homebrew::DevCmd::VendorGems do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/bump-revision_spec.rb
Ruby
bsd-2-clause
47,751
main
214
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/bump-revision" RSpec.describe Homebrew::DevCmd::BumpRevision do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/create_spec.rb
Ruby
bsd-2-clause
47,751
main
874
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/create" RSpec.describe Homebrew::DevCmd::Create do let(:url) { "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" } let(:formula_file) { CoreTap.instance.new_formula_path("testball") } it_behaves_like "pa...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/sh_spec.rb
Ruby
bsd-2-clause
47,751
main
442
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/sh" RSpec.describe Homebrew::DevCmd::Sh do it_behaves_like "parseable arguments" it "runs a shell with the Homebrew environment", :integration_test do expect { brew "sh", "SHELL" => which("true") } .t...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/bottle_spec.rb
Ruby
bsd-2-clause
47,751
main
23,212
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/bottle" RSpec.describe Homebrew::DevCmd::Bottle do def stub_hash(parameters) <<~EOS { "#{parameters[:name]}":{ "formula":{ "pkg_version":"#{parameters[:version]}", ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/update-portable-ruby_spec.rb
Ruby
bsd-2-clause
47,751
main
227
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/update-portable-ruby" RSpec.describe Homebrew::DevCmd::UpdatePortableRuby do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/formula-analytics_spec.rb
Ruby
bsd-2-clause
47,751
main
222
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/formula-analytics" RSpec.describe Homebrew::DevCmd::FormulaAnalytics do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/bump_spec.rb
Ruby
bsd-2-clause
47,751
main
6,942
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "bump_version_parser" require "dev-cmd/bump" RSpec.describe Homebrew::DevCmd::Bump do subject(:bump) { described_class.new(["test"]) } let(:f_basic) do formula("basic_formula") do desc "Basic formula" ur...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/bump-unversioned-casks_spec.rb
Ruby
bsd-2-clause
47,751
main
231
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/bump-unversioned-casks" RSpec.describe Homebrew::DevCmd::BumpUnversionedCasks do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/generate-man-completions_spec.rb
Ruby
bsd-2-clause
47,751
main
235
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/generate-man-completions" RSpec.describe Homebrew::DevCmd::GenerateManCompletions do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/update-test_spec.rb
Ruby
bsd-2-clause
47,751
main
210
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/update-test" RSpec.describe Homebrew::DevCmd::UpdateTest do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/pr-automerge_spec.rb
Ruby
bsd-2-clause
47,751
main
212
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/pr-automerge" RSpec.describe Homebrew::DevCmd::PrAutomerge do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/prof_spec.rb
Ruby
bsd-2-clause
47,751
main
815
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/prof" RSpec.describe Homebrew::DevCmd::Prof do it_behaves_like "parseable arguments" describe "integration tests", :integration_test, :needs_network do after do FileUtils.rm_rf HOMEBREW_LIBRARY_PATH/"...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb
Ruby
bsd-2-clause
47,751
main
2,216
# typed: false # frozen_string_literal: true require "dev-cmd/determine-test-runners" require "cmd/shared_examples/args_parse" RSpec.describe Homebrew::DevCmd::DetermineTestRunners do def get_runners(file) runner_line = File.open(file, &:first) json_text = runner_line[/runners=(.*)/, 1] runner_hash = JS...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/update-python-resources_spec.rb
Ruby
bsd-2-clause
47,751
main
233
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/update-python-resources" RSpec.describe Homebrew::DevCmd::UpdatePythonResources do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/which-update_spec.rb
Ruby
bsd-2-clause
47,751
main
212
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/which-update" RSpec.describe Homebrew::DevCmd::WhichUpdate do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/formula_spec.rb
Ruby
bsd-2-clause
47,751
main
470
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/formula" RSpec.describe Homebrew::DevCmd::FormulaCmd do it_behaves_like "parseable arguments" it "prints a given Formula's path", :integration_test do formula_file = setup_test_formula "testball" expec...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/contributions_spec.rb
Ruby
bsd-2-clause
47,751
main
215
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/contributions" RSpec.describe Homebrew::DevCmd::Contributions do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/style_spec.rb
Ruby
bsd-2-clause
47,751
main
202
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/style" RSpec.describe Homebrew::DevCmd::StyleCmd do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/unpack_spec.rb
Ruby
bsd-2-clause
47,751
main
834
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/unpack" RSpec.describe Homebrew::DevCmd::Unpack do it_behaves_like "parseable arguments" it "unpacks a given Formula's archive", :integration_test do setup_test_formula "testball" mktmpdir do |path| ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/generate-cask-api_spec.rb
Ruby
bsd-2-clause
47,751
main
221
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/generate-cask-api" RSpec.describe Homebrew::DevCmd::GenerateCaskApi do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/verify_spec.rb
Ruby
bsd-2-clause
47,751
main
201
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/verify" RSpec.describe Homebrew::DevCmd::Verify do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/unbottled_spec.rb
Ruby
bsd-2-clause
47,751
main
509
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/unbottled" RSpec.describe Homebrew::DevCmd::Unbottled do it_behaves_like "parseable arguments" it "prints that an unbottled formula with no dependencies is ready to bottle", :integration_test do setup_test_...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/pr-publish_spec.rb
Ruby
bsd-2-clause
47,751
main
208
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/pr-publish" RSpec.describe Homebrew::DevCmd::PrPublish do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/generate-cask-ci-matrix_spec.rb
Ruby
bsd-2-clause
47,751
main
9,724
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/generate-cask-ci-matrix" RSpec.describe Homebrew::DevCmd::GenerateCaskCiMatrix do subject(:generate_matrix) { described_class.new(["test"]) } let(:c_on_system_depends_on_mixed) do Cask::Cask.new("test-on-sy...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/update-sponsors_spec.rb
Ruby
bsd-2-clause
47,751
main
218
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/update-sponsors" RSpec.describe Homebrew::DevCmd::UpdateSponsors do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/irb_spec.rb
Ruby
bsd-2-clause
47,751
main
1,097
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/irb" RSpec.describe Homebrew::DevCmd::Irb do it_behaves_like "parseable arguments" describe "integration test" do let(:history_file) { Pathname("#{Dir.home}/.brew_irb_history") } after do history...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/lgtm_spec.rb
Ruby
bsd-2-clause
47,751
main
12,602
# typed: false # frozen_string_literal: true require "open3" require "cmd/shared_examples/args_parse" require "dev-cmd/lgtm" require "utils/tty" RSpec.describe Homebrew::DevCmd::Lgtm do it_behaves_like "parseable arguments" describe "#run" do subject(:lgtm) { described_class.new(args) } let(:args) { []...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/update-maintainers_spec.rb
Ruby
bsd-2-clause
47,751
main
224
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/update-maintainers" RSpec.describe Homebrew::DevCmd::UpdateMaintainers do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/test_spec.rb
Ruby
bsd-2-clause
47,751
main
1,035
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/test" require "sandbox" RSpec.describe Homebrew::DevCmd::Test do it_behaves_like "parseable arguments" it "tests a given Formula", :integration_test do install_test_formula "testball", <<~'RUBY' test ...
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/update-perl-resources_spec.rb
Ruby
bsd-2-clause
47,751
main
229
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/update-perl-resources" RSpec.describe Homebrew::DevCmd::UpdatePerlResources do it_behaves_like "parseable arguments" end
github
Homebrew/brew
https://github.com/Homebrew/brew
Library/Homebrew/test/dev-cmd/dispatch-build-bottle_spec.rb
Ruby
bsd-2-clause
47,751
main
229
# typed: strict # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/dispatch-build-bottle" RSpec.describe Homebrew::DevCmd::DispatchBuildBottle do it_behaves_like "parseable arguments" end