language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
Homebrew
brew
0e3f1ab27337338c19996a15e8f1e3b72ec270f1.json
Note cases when pinned formulae get upgraded. Fixes #3021.
Library/Homebrew/cmd/unpin.rb
@@ -1,6 +1,6 @@ #: * `unpin` <formulae>: -#: Unpin <formulae>, allowing them to be upgraded by `brew upgrade`. See also -#: `pin`. +#: Unpin <formulae>, allowing them to be upgraded by `brew upgrade <formulae>`. +#: See also `pin`. require "formula"
true
Other
Homebrew
brew
0e3f1ab27337338c19996a15e8f1e3b72ec270f1.json
Note cases when pinned formulae get upgraded. Fixes #3021.
docs/FAQ.md
@@ -26,6 +26,8 @@ To allow that formulae to update again: brew unpin <formula> +Note that pinned, outdated formulae that are depended on by another formula will be upgraded when required as we do not allow formulae to be built against non-latest versions. + ## How do I uninstall old versions of a formula? By default, Homebrew does not uninstall old versions of a formula, so over time you will accumulate old versions. To remove them, simply use:
true
Other
Homebrew
brew
0e3f1ab27337338c19996a15e8f1e3b72ec270f1.json
Note cases when pinned formulae get upgraded. Fixes #3021.
docs/Manpage.md
@@ -364,7 +364,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note * `pin` `formulae`: Pin the specified `formulae`, preventing them from being upgraded when - issuing the `brew upgrade` command. See also `unpin`. + issuing the `brew upgrade `formulae`` command (but can still be upgraded + as dependencies for other formulae). See also `unpin`. * `postinstall` `formula`: Rerun the post-install steps for `formula`. @@ -529,8 +530,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note source. This is useful for creating patches for the software. * `unpin` `formulae`: - Unpin `formulae`, allowing them to be upgraded by `brew upgrade`. See also - `pin`. + Unpin `formulae`, allowing them to be upgraded by `brew upgrade `formulae``. + See also `pin`. * `untap` `tap`: Remove a tapped repository.
true
Other
Homebrew
brew
0e3f1ab27337338c19996a15e8f1e3b72ec270f1.json
Note cases when pinned formulae get upgraded. Fixes #3021.
manpages/brew-cask.1
@@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW\-CASK" "1" "July 2017" "Homebrew" "brew-cask" +.TH "BREW\-CASK" "1" "August 2017" "Homebrew" "brew-cask" . .SH "NAME" \fBbrew\-cask\fR \- a friendly binary installer for macOS
true
Other
Homebrew
brew
0e3f1ab27337338c19996a15e8f1e3b72ec270f1.json
Note cases when pinned formulae get upgraded. Fixes #3021.
manpages/brew.1
@@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW" "1" "July 2017" "Homebrew" "brew" +.TH "BREW" "1" "August 2017" "Homebrew" "brew" . .SH "NAME" \fBbrew\fR \- The missing package manager for macOS @@ -378,7 +378,7 @@ If \fB\-\-fetch\-HEAD\fR is passed, fetch the upstream repository to detect if t . .TP \fBpin\fR \fIformulae\fR -Pin the specified \fIformulae\fR, preventing them from being upgraded when issuing the \fBbrew upgrade\fR command\. See also \fBunpin\fR\. +Pin the specified \fIformulae\fR, preventing them from being upgraded when issuing the \fBbrew upgrade <formulae>\fR command (but can still be upgraded as dependencies for other formulae)\. See also \fBunpin\fR\. . .TP \fBpostinstall\fR \fIformula\fR @@ -549,7 +549,7 @@ If \fB\-\-git\fR (or \fB\-g\fR) is passed, a Git repository will be initialized . .TP \fBunpin\fR \fIformulae\fR -Unpin \fIformulae\fR, allowing them to be upgraded by \fBbrew upgrade\fR\. See also \fBpin\fR\. +Unpin \fIformulae\fR, allowing them to be upgraded by \fBbrew upgrade <formulae>\fR\. See also \fBpin\fR\. . .TP \fBuntap\fR \fItap\fR
true
Other
Homebrew
brew
93051b27d6886dae6df01544c86df579f21f6410.json
formula_cellar_checks: fix broken dylib spacing.
Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
@@ -69,7 +69,7 @@ def check_linkage return unless checker.broken_dylibs? output = <<-EOS.undent #{formula} has broken dynamic library links: - #{checker.broken_dylibs.to_a * "\n "} + #{checker.broken_dylibs.to_a * "\n "} EOS tab = Tab.for_keg(keg) if tab.poured_from_bottle
false
Other
Homebrew
brew
69799d97b1e7314912b2ee234dec2c179c5fb969.json
formula_cellar_checks: remove stray backtick.
Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
@@ -75,7 +75,7 @@ def check_linkage if tab.poured_from_bottle output += <<-EOS.undent Rebuild this from source with: - brew reinstall --build-from-source #{formula}` + brew reinstall --build-from-source #{formula} If that's successful, file an issue#{formula.tap ? " here:\n #{formula.tap.issues_url}" : "."} EOS end
false
Other
Homebrew
brew
12c454822aff7320cee503c0708d30a99f4a0e0c.json
sandbox: stop printing message. We’re always using the sandbox where possible now so this is just noise for the vast majority of our users.
Library/Homebrew/cmd/postinstall.rb
@@ -29,8 +29,6 @@ def run_post_install(formula) args << "--devel" end - Sandbox.print_sandbox_message if Sandbox.formula?(formula) - Utils.safe_fork do if Sandbox.formula?(formula) sandbox = Sandbox.new
true
Other
Homebrew
brew
12c454822aff7320cee503c0708d30a99f4a0e0c.json
sandbox: stop printing message. We’re always using the sandbox where possible now so this is just noise for the vast majority of our users.
Library/Homebrew/dev-cmd/test.rb
@@ -65,8 +65,6 @@ def test args << "--devel" end - Sandbox.print_sandbox_message if Sandbox.test? - Utils.safe_fork do if Sandbox.test? sandbox = Sandbox.new
true
Other
Homebrew
brew
12c454822aff7320cee503c0708d30a99f4a0e0c.json
sandbox: stop printing message. We’re always using the sandbox where possible now so this is just noise for the vast majority of our users.
Library/Homebrew/formula_installer.rb
@@ -679,8 +679,6 @@ def build #{formula.specified_path} ].concat(build_argv) - Sandbox.print_sandbox_message if Sandbox.formula?(formula) - Utils.safe_fork do # Invalidate the current sudo timestamp in case a build script calls sudo. # Travis CI's Linux sudoless workers have a weird sudo that fails here.
true
Other
Homebrew
brew
12c454822aff7320cee503c0708d30a99f4a0e0c.json
sandbox: stop printing message. We’re always using the sandbox where possible now so this is just noise for the vast majority of our users.
Library/Homebrew/sandbox.rb
@@ -18,12 +18,6 @@ def self.test? !ARGV.no_sandbox? end - def self.print_sandbox_message - return if @printed_sandbox_message - ohai "Using the sandbox" - @printed_sandbox_message = true - end - def initialize @profile = SandboxProfile.new end
true
Other
Homebrew
brew
d9c81901c3a7f6ed112a99e9067d78fb9a2c3293.json
audit: Add tests for rubocop methods in line_cop.rb
Library/Homebrew/test/rubocops/lines_cop_spec.rb
@@ -200,5 +200,274 @@ class Foo < Formula expect_offense(expected, actual) end end + + it "with invalid rebuild" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + bottle do + rebuild 0 + sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra + end + end + EOS + + expected_offenses = [{ message: "'rebuild 0' should be removed", + severity: :convention, + line: 5, + column: 4, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with OS.linux? check" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + bottle do + if OS.linux? + nil + end + sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra + end + end + EOS + + expected_offenses = [{ message: "Don't use OS.linux?; Homebrew/core only supports macOS", + severity: :convention, + line: 5, + column: 7, + source: source }] + + inspect_source(cop, source, "/homebrew-core/") + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with fails_with :llvm" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + bottle do + sha256 "fe0679b932dd43a87fd415b609a7fbac7a069d117642ae8ebaac46ae1fb9f0b3" => :sierra + end + fails_with :llvm do + build 2335 + cause "foo" + end + end + EOS + + expected_offenses = [{ message: "'fails_with :llvm' is now a no-op so should be removed", + severity: :convention, + line: 7, + column: 2, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with def test" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + + def test + assert_equals "1", "1" + end + end + EOS + + expected_offenses = [{ message: "Use new-style test definitions (test do)", + severity: :convention, + line: 5, + column: 2, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with def options" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + + def options + [["--bar", "desc"]] + end + end + EOS + + expected_offenses = [{ message: "Use new-style option definitions", + severity: :convention, + line: 5, + column: 2, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with deprecated skip_clean call" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + skip_clean :all + end + EOS + + expected_offenses = [{ message: "`skip_clean :all` is deprecated; brew no longer strips symbols\n" \ + "\tPass explicit paths to prevent Homebrew from removing empty folders.", + severity: :convention, + line: 4, + column: 2, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with build.universal?" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + if build.universal? + "foo" + end + end + EOS + + expected_offenses = [{ message: "macOS has been 64-bit only so build.universal? is deprecated.", + severity: :convention, + line: 4, + column: 5, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with ENV.universal_binary" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + if build? + ENV.universal_binary + end + end + EOS + + expected_offenses = [{ message: "macOS has been 64-bit only since 10.6 so ENV.universal_binary is deprecated.", + severity: :convention, + line: 5, + column: 5, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with ENV.universal_binary" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + if build? + ENV.x11 + end + end + EOS + + expected_offenses = [{ message: 'Use "depends_on :x11" instead of "ENV.x11"', + severity: :convention, + line: 5, + column: 5, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with ruby-macho alternatives" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + system "install_name_tool", "-id" + end + EOS + + expected_offenses = [{ message: 'Use ruby-macho instead of calling "install_name_tool"', + severity: :convention, + line: 4, + column: 10, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end + + it "with npm install without language::Node args" do + source = <<-EOS.undent + class Foo < Formula + desc "foo" + url 'http://example.com/foo-1.0.tgz' + system "npm", "install" + end + EOS + + expected_offenses = [{ message: "Use Language::Node for npm install args", + severity: :convention, + line: 4, + column: 17, + source: source }] + + inspect_source(cop, source) + + expected_offenses.zip(cop.offenses).each do |expected, actual| + expect_offense(expected, actual) + end + end end end
false
Other
Homebrew
brew
06ecad2950b8890eb9175081e9f9231cd0542470.json
formula: Remove reference to homebrew/x11 That tap is now defunct. Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
Library/Homebrew/formula.rb
@@ -2213,7 +2213,7 @@ def go_resource(name, &block) # depends_on :arch => :x86_64 # If this formula only builds on Intel x86 64-bit. # depends_on :arch => :ppc # Only builds on PowerPC? # depends_on :ld64 # Sometimes ld fails on `MacOS.version < :leopard`. Then use this. - # depends_on :x11 # X11/XQuartz components. Non-optional X11 deps should go in Homebrew/Homebrew-x11 + # depends_on :x11 # X11/XQuartz components. # depends_on :osxfuse # Permits the use of the upstream signed binary or our source package. # depends_on :tuntap # Does the same thing as above. This is vital for Yosemite and above. # depends_on :mysql => :recommended</pre>
false
Other
Homebrew
brew
eaea27c960de3bf76fc9976bfad037c0a559018d.json
formula_installer: restore build_bottle defaults.
Library/Homebrew/formula_installer.rb
@@ -46,7 +46,7 @@ def initialize(formula) @ignore_deps = false @only_deps = false @build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source? - @build_bottle = ARGV.build_bottle? + @build_bottle = false @force_bottle = ARGV.force_bottle? @interactive = false @git = false @@ -543,7 +543,6 @@ def install_dependency(dep, inherited_options) fi.options |= inherited_options fi.options &= df.options fi.build_from_source = ARGV.build_formula_from_source?(df) - fi.build_bottle = false fi.force_bottle = false fi.verbose = verbose? fi.quieter = quieter?
false
Other
Homebrew
brew
f89e09b7857e8e3a6f6cd30258aa5927a1ac2872.json
Add spec for `conflicts_with cask`.
Library/Homebrew/test/cask/conflicts_with_spec.rb
@@ -0,0 +1,23 @@ +describe "conflicts_with", :cask do + describe "conflicts_with cask" do + let(:local_caffeine) { + Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") + } + + let(:with_conflicts_with) { + Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-conflicts-with.rb") + } + + it "installs the dependency of a Cask and the Cask itself", :focus do + Hbc::Installer.new(local_caffeine).install + + expect(local_caffeine).to be_installed + + expect { + Hbc::Installer.new(with_conflicts_with).install + }.to raise_error(Hbc::CaskConflictError, "Cask 'with-conflicts-with' conflicts with 'local-caffeine'.") + + expect(with_conflicts_with).not_to be_installed + end + end +end
true
Other
Homebrew
brew
f89e09b7857e8e3a6f6cd30258aa5927a1ac2872.json
Add spec for `conflicts_with cask`.
Library/Homebrew/test/support/fixtures/cask/Casks/with-conflicts-with.rb
@@ -5,7 +5,7 @@ url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" homepage 'http://example.com/with-conflicts-with' - conflicts_with formula: 'unar' + conflicts_with cask: 'local-caffeine' app 'Caffeine.app' end
true
Other
Homebrew
brew
1c3ece12b997206fd9cb0b2bf98c25da8332fe10.json
Tap.each: return an enumerable when no block given
Library/Homebrew/tap.rb
@@ -486,6 +486,8 @@ def ==(other) def self.each return unless TAP_DIRECTORY.directory? + return to_enum unless block_given? + TAP_DIRECTORY.subdirs.each do |user| user.subdirs.each do |repo| yield fetch(user.basename.to_s, repo.basename.to_s)
true
Other
Homebrew
brew
1c3ece12b997206fd9cb0b2bf98c25da8332fe10.json
Tap.each: return an enumerable when no block given
Library/Homebrew/test/tap_spec.rb
@@ -297,6 +297,12 @@ def setup_git_repo subject.config["foo"] = nil expect(subject.config["foo"]).to be nil end + + describe "#each" do + it "returns an enumerator if no block is passed" do + expect(described_class.each).to be_an_instance_of(Enumerator) + end + end end describe CoreTap do
true
Other
Homebrew
brew
980db9d3fb6671c7562f97dfa3dd4f22fd74083f.json
Remove errant pkg-config libdir We found an issue in Linuxbrew/homebrew-core#3366 where the addition of "/usr/lib/pkg-config" causes compilation issues if system pkg-config files are in that directory on Linux. Removing the line from here and adding it into the mac superenv.
Library/Homebrew/extend/ENV/super.rb
@@ -138,7 +138,6 @@ def determine_pkg_config_path def determine_pkg_config_libdir PATH.new( - "/usr/lib/pkgconfig", homebrew_extra_pkg_config_paths, ).existing end
false
Other
Homebrew
brew
85da3762331dda87bd6acaae2977cc470c9d2658.json
audit: add additional php header ignore patterns
Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
@@ -6,7 +6,7 @@ def check_shadowed_headers formula.name.start_with?(formula_name) end - return if formula.name =~ /^php\d+$/ + return if formula.name =~ /^php(@?\d+\.?\d*?)?$/ return if MacOS.version < :mavericks && formula.name.start_with?("postgresql") return if MacOS.version < :yosemite && formula.name.start_with?("memcached")
false
Other
Homebrew
brew
732e0aa689b9a7f9a63c0a99472a9512a14ac291.json
formula: Remove reference to Homebrew/Homebrew That repo is now defunct. Reference homebrew-core instead. Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
Library/Homebrew/formula.rb
@@ -2072,8 +2072,8 @@ def mirror(val) # # If you maintain your own repository, you can add your own bottle links. # https://docs.brew.sh/Bottles.html - # You can ignore this block entirely if submitting to Homebrew/Homebrew, It'll be - # handled for you by the Brew Test Bot. + # You can ignore this block entirely if submitting to Homebrew/homebrew-core. + # It'll be handled for you by the Brew Test Bot. # # <pre>bottle do # root_url "https://example.com" # Optional root to calculate bottle URLs
false
Other
Homebrew
brew
8779784d7092b6f1175eaf8c780c4d3cc88b4b16.json
Fix trash script.
Library/Homebrew/cask/lib/hbc/artifact/uninstall_base.rb
@@ -247,8 +247,11 @@ def trash_paths(*paths) set output to "" repeat with i from 1 to (count trashedItems) - set item i of trashedItems to POSIX path of (item i of trashedItems as string) - set output to output & (item i of trashedItems) & (do shell script "printf \"\\0\"") + set trashedItem to POSIX path of (item i of trashedItems as string) + set output to output & trashedItem + if i < count trashedItems then + set output to output & (do shell script "printf \"\\0\"") + end if end repeat return output
false
Other
Homebrew
brew
a83baba8b50e29e680b89588ca19347ac0133608.json
formula_installer: use default_formula for bottles This was the original, intended functionality before this was broken in fe117bf79b244c42b7e4049d353c3c003eae4880. Fixes https://github.com/Homebrew/homebrew-core/issues/13680.
Library/Homebrew/formula_installer.rb
@@ -402,14 +402,13 @@ def check_requirements(req_map) raise UnsatisfiedRequirements, fatals end - def install_requirement_formula?(req, dependent, build) - req_dependency = req.to_dependency + def install_requirement_formula?(req_dependency, req, install_bottle_for_dependent) return false unless req_dependency return true unless req.satisfied? return false if req.run? return true if build_bottle? return true if req.satisfied_by_formula? - install_bottle_for?(dependent, build) + install_bottle_for_dependent end def runtime_requirements(formula) @@ -429,19 +428,21 @@ def expand_requirements runtime_requirements = runtime_requirements(f) f.recursive_requirements do |dependent, req| build = effective_build_options_for(dependent) + install_bottle_for_dependent = install_bottle_for?(dependent, build) + use_default_formula = install_bottle_for_dependent || build_bottle? + req_dependency = req.to_dependency(use_default_formula: use_default_formula) if (req.optional? || req.recommended?) && build.without?(req) Requirement.prune - elsif req.build? && install_bottle_for?(dependent, build) + elsif req.build? && install_bottle_for_dependent Requirement.prune - elsif install_requirement_formula?(req, dependent, build) - dep = req.to_dependency - deps.unshift(dep) - formulae.unshift(dep.to_formula) + elsif install_requirement_formula?(req_dependency, req, install_bottle_for_dependent) + deps.unshift(req_dependency) + formulae.unshift(req_dependency.to_formula) Requirement.prune elsif req.satisfied? Requirement.prune - elsif !runtime_requirements.include?(req) && install_bottle_for?(dependent, build) + elsif !runtime_requirements.include?(req) && install_bottle_for_dependent Requirement.prune else unsatisfied_reqs[dependent] << req
true
Other
Homebrew
brew
a83baba8b50e29e680b89588ca19347ac0133608.json
formula_installer: use default_formula for bottles This was the original, intended functionality before this was broken in fe117bf79b244c42b7e4049d353c3c003eae4880. Fixes https://github.com/Homebrew/homebrew-core/issues/13680.
Library/Homebrew/requirement.rb
@@ -129,8 +129,10 @@ def satisfied_by_formula? !@formula.nil? end - def to_dependency - if formula =~ HOMEBREW_TAP_FORMULA_REGEX + def to_dependency(use_default_formula: false) + if use_default_formula && default_formula? + Dependency.new(self.class.default_formula, tags, method(:modify_build_environment), name) + elsif formula =~ HOMEBREW_TAP_FORMULA_REGEX TapDependency.new(formula, tags, method(:modify_build_environment), name) elsif formula Dependency.new(formula, tags, method(:modify_build_environment), name)
true
Other
Homebrew
brew
a83baba8b50e29e680b89588ca19347ac0133608.json
formula_installer: use default_formula for bottles This was the original, intended functionality before this was broken in fe117bf79b244c42b7e4049d353c3c003eae4880. Fixes https://github.com/Homebrew/homebrew-core/issues/13680.
Library/Homebrew/test/formula_installer_spec.rb
@@ -135,22 +135,22 @@ class #{Formulary.class_s(dep_name)} < Formula }.to raise_error(CannotInstallFormulaError) end - describe "#install_requirement_formula?" do + describe "#install_requirement_formula?", :focus do before do @requirement = Python3Requirement.new + @requirement_dependency = @requirement.to_dependency + @install_bottle_for_dependent = false allow(@requirement).to receive(:satisfied?).and_return(satisfied?) allow(@requirement).to receive(:satisfied_by_formula?).and_return(satisfied_by_formula?) - allow_any_instance_of(Dependency).to receive(:installed?).and_return(installed?) @dependent = formula do url "foo" version "0.1" depends_on :python3 end - @build = BuildOptions.new [], [] @fi = FormulaInstaller.new(@dependent) end - subject { @fi.install_requirement_formula?(@requirement, @dependent, @build) } + subject { @fi.install_requirement_formula?(@requirement_dependency, @requirement, @install_bottle_for_dependent) } context "it returns false when requirement is satisfied" do let(:satisfied?) { true }
true
Other
Homebrew
brew
7ec05052003ecf6142d94aeaa62f4b4bd84a569d.json
Preserve link status on reinstall/upgrade. This means if a user has manually `brew unlink` or `brew link --force`d something then that status will be preserved after they `brew upgrade` or `brew reinstall` that formula. This generally should make things that are keg-only by default easier to swallow.
Library/Homebrew/cmd/reinstall.rb
@@ -23,6 +23,7 @@ def reinstall def reinstall_formula(f) if f.opt_prefix.directory? keg = Keg.new(f.opt_prefix.resolved_path) + keg_was_linked = keg.linked? backup keg end @@ -37,6 +38,7 @@ def reinstall_formula(f) fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.bottle?) fi.interactive = ARGV.interactive? fi.git = ARGV.git? + fi.keg_was_linked = keg_was_linked fi.prelude oh1 "Reinstalling #{f.full_name} #{options.to_a.join " "}" @@ -46,7 +48,7 @@ def reinstall_formula(f) rescue FormulaInstallationAlreadyAttemptedError # next rescue Exception - ignore_interrupts { restore_backup(keg, f) } + ignore_interrupts { restore_backup(keg, keg_was_linked) } raise else backup_path(keg).rmtree if backup_path(keg).exist? @@ -57,15 +59,15 @@ def backup(keg) keg.rename backup_path(keg) end - def restore_backup(keg, formula) + def restore_backup(keg, keg_was_linked) path = backup_path(keg) return unless path.directory? Pathname.new(keg).rmtree if keg.exist? path.rename keg - keg.link unless formula.keg_only? + keg.link if keg_was_linked end def backup_path(path)
true
Other
Homebrew
brew
7ec05052003ecf6142d94aeaa62f4b4bd84a569d.json
Preserve link status on reinstall/upgrade. This means if a user has manually `brew unlink` or `brew link --force`d something then that status will be preserved after they `brew upgrade` or `brew reinstall` that formula. This generally should make things that are keg-only by default easier to swallow.
Library/Homebrew/cmd/upgrade.rb
@@ -106,6 +106,7 @@ def upgrade_formula(f) .map(&:linked_keg) .select(&:directory?) .map { |k| Keg.new(k.resolved_path) } + linked_kegs = outdated_kegs.select(&:linked?) if f.opt_prefix.directory? keg = Keg.new(f.opt_prefix.resolved_path) @@ -153,7 +154,7 @@ def upgrade_formula(f) ensure # restore previous installation state if build failed begin - outdated_kegs.each(&:link) unless f.installed? + linked_kegs.each(&:link) unless f.installed? rescue nil end
true
Other
Homebrew
brew
7ec05052003ecf6142d94aeaa62f4b4bd84a569d.json
Preserve link status on reinstall/upgrade. This means if a user has manually `brew unlink` or `brew link --force`d something then that status will be preserved after they `brew upgrade` or `brew reinstall` that formula. This generally should make things that are keg-only by default easier to swallow.
Library/Homebrew/formula_installer.rb
@@ -37,10 +37,17 @@ def self.mode_attr_accessor(*names) mode_attr_accessor :show_summary_heading, :show_header mode_attr_accessor :build_from_source, :force_bottle mode_attr_accessor :ignore_deps, :only_deps, :interactive, :git - mode_attr_accessor :verbose, :debug, :quieter + mode_attr_accessor :verbose, :debug, :quieter, :keg_was_linked def initialize(formula) @formula = formula + @rack_was_present = formula.rack.directory? + @keg_was_linked = if formula.linked_keg.directory? + keg = Keg.new(formula.linked_keg.resolved_path) + keg.linked? + else + false + end @show_header = false @ignore_deps = false @only_deps = false @@ -524,6 +531,7 @@ def install_dependency(dep, inherited_options) if df.linked_keg.directory? linked_keg = Keg.new(df.linked_keg.resolved_path) + keg_was_linked = keg.linked? linked_keg.unlink end @@ -542,6 +550,7 @@ def install_dependency(dep, inherited_options) fi.verbose = verbose? fi.quieter = quieter? fi.debug = debug? + fi.keg_was_linked = keg_was_linked fi.installed_as_dependency = true fi.installed_on_request = false fi.prelude @@ -551,7 +560,7 @@ def install_dependency(dep, inherited_options) rescue Exception ignore_interrupts do tmp_keg.rename(installed_keg) if tmp_keg && !installed_keg.directory? - linked_keg.link if linked_keg + linked_keg.link if keg_was_linked end raise else @@ -712,7 +721,13 @@ def build end def link(keg) - if formula.keg_only? + link_formula = if @rack_was_present + keg_was_linked? + else + !formula.keg_only? + end + + unless link_formula begin keg.optlink rescue Keg::LinkError => e
true
Other
Homebrew
brew
7ec05052003ecf6142d94aeaa62f4b4bd84a569d.json
Preserve link status on reinstall/upgrade. This means if a user has manually `brew unlink` or `brew link --force`d something then that status will be preserved after they `brew upgrade` or `brew reinstall` that formula. This generally should make things that are keg-only by default easier to swallow.
Library/Homebrew/test/bottle_hooks_spec.rb
@@ -12,6 +12,8 @@ local_bottle_path: nil, bottle_disabled?: false, some_random_method: true, + linked_keg: Pathname("foo"), + rack: Pathname("bar"), ) end
true
Other
Homebrew
brew
0a10ca61dc6d626bfe72b3a4e5501ebb6ad15a81.json
formula_support: add provided_pre_high_sierra keg_only
Library/Homebrew/formula_support.rb
@@ -19,6 +19,8 @@ def valid? MacOS.version < :mavericks when :provided_pre_el_capitan MacOS.version < :el_capitan + when :provided_pre_high_sierra + MacOS.version < :high_sierra when :provided_until_xcode43 MacOS::Xcode.installed? && MacOS::Xcode.version < "4.3" when :provided_until_xcode5 @@ -51,6 +53,9 @@ def to_s when :provided_pre_el_capitan then <<-EOS.undent macOS already provides this software in versions before El Capitan EOS + when :provided_pre_high_sierra then <<-EOS.undent + macOS already provides this software in versions before High Sierra + EOS when :provided_until_xcode43 then <<-EOS.undent Xcode provides this software prior to version 4.3 EOS
false
Other
Homebrew
brew
f4501787635a8732909ee811b1b850d52802e928.json
Fix style error
Library/Homebrew/cask/lib/hbc/cli/internal_audit_modified_casks.rb
@@ -117,7 +117,6 @@ def report_failures odie "audit failed for #{Formatter.pluralize(num_failed, "cask")}: " \ "#{failed_casks.join(" ")}" end - end end end
false
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/accessibility_spec.rb
@@ -20,9 +20,7 @@ sudo: true, ) - shutup do - installer.enable_accessibility_access - end + installer.enable_accessibility_access end it "warns about disabling accessibility access on old macOS releases" do @@ -42,9 +40,7 @@ sudo: true, ) - shutup do - installer.enable_accessibility_access - end + installer.enable_accessibility_access end it "can disable accessibility access" do @@ -54,9 +50,7 @@ sudo: true, ) - shutup do - installer.disable_accessibility_access - end + installer.disable_accessibility_access end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/alt_target_spec.rb
@@ -17,9 +17,7 @@ expect(source_path).to be_a_directory expect(target_path).not_to exist - shutup do - install_phase.call - end + install_phase.call expect(target_path).to be_a_directory expect(source_path).not_to exist @@ -40,9 +38,7 @@ appsubdir = cask.staged_path.join("subdir").tap(&:mkpath) FileUtils.mv(source_path, appsubdir) - shutup do - install_phase.call - end + install_phase.call expect(target_path).to be_a_directory expect(appsubdir.join("Caffeine.app")).not_to exist @@ -53,9 +49,7 @@ staged_app_copy = source_path.sub("Caffeine.app", "Caffeine Deluxe.app") FileUtils.cp_r source_path, staged_app_copy - shutup do - install_phase.call - end + install_phase.call expect(target_path).to be_a_directory expect(source_path).not_to exist
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/app_spec.rb
@@ -16,9 +16,7 @@ describe "install_phase" do it "installs the given app using the proper target directory" do - shutup do - install_phase - end + install_phase expect(target_path).to be_a_directory expect(source_path).not_to exist @@ -39,9 +37,7 @@ appsubdir = cask.staged_path.join("subdir").tap(&:mkpath) FileUtils.mv(source_path, appsubdir) - shutup do - install_phase - end + install_phase expect(target_path).to be_a_directory expect(appsubdir.join("Caffeine.app")).not_to exist @@ -52,9 +48,7 @@ staged_app_copy = source_path.sub("Caffeine.app", "Caffeine Deluxe.app") FileUtils.cp_r source_path, staged_app_copy - shutup do - install_phase - end + install_phase expect(target_path).to be_a_directory expect(source_path).not_to exist @@ -201,15 +195,11 @@ describe "uninstall_phase" do it "deletes managed apps" do - shutup do - install_phase - end + install_phase expect(target_path).to exist - shutup do - uninstall_phase - end + uninstall_phase expect(target_path).not_to exist end @@ -225,9 +215,7 @@ describe "app is correctly installed" do it "returns the path to the app" do - shutup do - install_phase - end + install_phase expect(contents).to eq(["#{target_path} (#{target_path.abv})"]) end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/binary_spec.rb
@@ -1,9 +1,7 @@ describe Hbc::Artifact::Binary, :cask do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-binary.rb").tap do |cask| - shutup do - InstallHelper.install_without_artifacts(cask) - end + InstallHelper.install_without_artifacts(cask) end } let(:expected_path) { Hbc.binarydir.join("binary") } @@ -22,28 +20,22 @@ } it "doesn't link the binary when --no-binaries is specified" do - shutup do - Hbc::Installer.new(cask, binaries: false).install - end - + Hbc::Installer.new(cask, binaries: false).install expect(expected_path).not_to exist end end it "links the binary to the proper directory" do - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase + expect(expected_path).to be_a_symlink expect(expected_path.readlink).to exist end context "when the binary is not executable" do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-non-executable-binary.rb").tap do |cask| - shutup do - InstallHelper.install_without_artifacts(cask) - end + InstallHelper.install_without_artifacts(cask) end } @@ -53,9 +45,7 @@ expect(FileUtils).to receive(:chmod) .with("+x", cask.staged_path.join("naked_non_executable")).and_call_original - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase expect(expected_path).to be_a_symlink expect(expected_path.readlink).to be_executable @@ -66,9 +56,7 @@ FileUtils.touch expected_path expect { - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase }.to raise_error(Hbc::CaskError) expect(expected_path).not_to be :symlink? @@ -77,37 +65,29 @@ it "clobbers an existing symlink" do expected_path.make_symlink("/tmp") - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase expect(File.readlink(expected_path)).not_to eq("/tmp") end it "creates parent directory if it doesn't exist" do FileUtils.rmdir Hbc.binarydir - shutup do - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::Binary.new(cask).install_phase expect(expected_path.exist?).to be true end context "binary is inside an app package" do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-embedded-binary.rb").tap do |cask| - shutup do - InstallHelper.install_without_artifacts(cask) - end + InstallHelper.install_without_artifacts(cask) end } it "links the binary to the proper directory" do - shutup do - Hbc::Artifact::App.new(cask).install_phase - Hbc::Artifact::Binary.new(cask).install_phase - end + Hbc::Artifact::App.new(cask).install_phase + Hbc::Artifact::Binary.new(cask).install_phase expect(expected_path).to be_a_symlink expect(expected_path.readlink).to exist
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/generic_artifact_spec.rb
@@ -21,9 +21,7 @@ end it "moves the artifact to the proper directory" do - shutup do - install_phase.call - end + install_phase.call expect(target_path).to be_a_directory expect(source_path).not_to exist @@ -33,9 +31,7 @@ target_path.mkpath expect { - shutup do - install_phase.call - end + install_phase.call }.to raise_error(Hbc::CaskError) expect(source_path).to be_a_directory
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/nested_container_spec.rb
@@ -5,9 +5,7 @@ InstallHelper.install_without_artifacts(c) end - shutup do - Hbc::Artifact::NestedContainer.new(cask).install_phase - end + Hbc::Artifact::NestedContainer.new(cask).install_phase expect(cask.staged_path.join("MyNestedApp.app")).to be_a_directory end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/pkg_spec.rb
@@ -3,9 +3,7 @@ let(:fake_system_command) { class_double(Hbc::SystemCommand) } before(:each) do - shutup do - InstallHelper.install_without_artifacts(cask) - end + InstallHelper.install_without_artifacts(cask) end describe "install_phase" do @@ -19,9 +17,7 @@ print_stdout: true, ) - shutup do - pkg.install_phase - end + pkg.install_phase end end @@ -61,9 +57,7 @@ print_stdout: true, ) - shutup do - pkg.install_phase - end + pkg.install_phase end end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/suite_spec.rb
@@ -11,9 +11,7 @@ end it "creates a suite containing the expected app" do - shutup do - install_phase.call - end + install_phase.call expect(target_path.join("Caffeine.app")).to exist end @@ -22,9 +20,7 @@ target_path.mkpath expect { - shutup do - install_phase.call - end + install_phase.call }.to raise_error(Hbc::CaskError) expect(source_path).to be_a_directory
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/two_apps_correct_spec.rb
@@ -17,9 +17,7 @@ end it "installs both apps using the proper target directory" do - shutup do - install_phase.call - end + install_phase.call expect(target_path_mini).to be_a_directory expect(source_path_mini).not_to exist @@ -32,9 +30,7 @@ let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-two-apps-subdir.rb") } it "installs both apps using the proper target directory" do - shutup do - install_phase.call - end + install_phase.call expect(target_path_mini).to be_a_directory expect(source_path_mini).not_to exist @@ -47,9 +43,7 @@ it "only uses apps when they are specified" do FileUtils.cp_r source_path_mini, source_path_mini.sub("Caffeine Mini.app", "Caffeine Deluxe.app") - shutup do - install_phase.call - end + install_phase.call expect(target_path_mini).to be_a_directory expect(source_path_mini).not_to exist
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/uninstall_no_zap_spec.rb
@@ -5,10 +5,8 @@ Hbc::Artifact::Zap.new(cask) } - before do - shutup do - InstallHelper.install_without_artifacts(cask) - end + before(:each) do + InstallHelper.install_without_artifacts(cask) end describe "#uninstall_phase" do
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/artifact/uninstall_zap_shared_examples.rb
@@ -3,11 +3,7 @@ let(:artifact) { described_class.new(cask, command: fake_system_command) } let(:fake_system_command) { Hbc::FakeSystemCommand } - subject do - shutup do - artifact.public_send(:"#{artifact_name}_phase") - end - end + subject { artifact.public_send(:"#{artifact_name}_phase") } context "using :launchctl" do let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-#{artifact_name}-launchctl.rb") }
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cask_spec.rb
@@ -39,19 +39,16 @@ end it "returns an instance of the Cask from a url" do - c = shutup do - Hbc::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb") - end + c = Hbc::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb") expect(c).to be_kind_of(Hbc::Cask) expect(c.token).to eq("local-caffeine") end it "raises an error when failing to download a Cask from a url" do expect { url = "file://#{tap_path}/Casks/notacask.rb" - shutup do - Hbc::CaskLoader.load(url) - end + + Hbc::CaskLoader.load(url) }.to raise_error(Hbc::CaskUnavailableError) end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/fetch_spec.rb
@@ -8,41 +8,31 @@ } it "allows download the installer of a Cask" do - shutup do - Hbc::CLI::Fetch.run("local-transmission", "local-caffeine") - end + Hbc::CLI::Fetch.run("local-transmission", "local-caffeine") expect(Hbc::CurlDownloadStrategy.new(local_transmission).cached_location).to exist expect(Hbc::CurlDownloadStrategy.new(local_caffeine).cached_location).to exist end it "prevents double fetch (without nuking existing installation)" do download_stategy = Hbc::CurlDownloadStrategy.new(local_transmission) - shutup do - Hbc::Download.new(local_transmission).perform - end + Hbc::Download.new(local_transmission).perform old_ctime = File.stat(download_stategy.cached_location).ctime - shutup do - Hbc::CLI::Fetch.run("local-transmission") - end + Hbc::CLI::Fetch.run("local-transmission") new_ctime = File.stat(download_stategy.cached_location).ctime expect(old_ctime.to_i).to eq(new_ctime.to_i) end it "allows double fetch with --force" do - shutup do - Hbc::Download.new(local_transmission).perform - end + Hbc::Download.new(local_transmission).perform download_stategy = Hbc::CurlDownloadStrategy.new(local_transmission) old_ctime = File.stat(download_stategy.cached_location).ctime sleep(1) - shutup do - Hbc::CLI::Fetch.run("local-transmission", "--force") - end + Hbc::CLI::Fetch.run("local-transmission", "--force") download_stategy = Hbc::CurlDownloadStrategy.new(local_transmission) new_ctime = File.stat(download_stategy.cached_location).ctime @@ -51,9 +41,7 @@ it "properly handles Casks that are not present" do expect { - shutup do - Hbc::CLI::Fetch.run("notacask") - end + Hbc::CLI::Fetch.run("notacask") }.to raise_error(Hbc::CaskError, "Fetch incomplete.") end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/install_spec.rb
@@ -14,9 +14,7 @@ end it "allows staging and activation of multiple Casks at once" do - shutup do - Hbc::CLI::Install.run("local-transmission", "local-caffeine") - end + Hbc::CLI::Install.run("local-transmission", "local-caffeine") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed expect(Hbc.appdir.join("Transmission.app")).to be_a_directory @@ -25,29 +23,21 @@ end it "skips double install (without nuking existing installation)" do - shutup do - Hbc::CLI::Install.run("local-transmission") - end - shutup do - Hbc::CLI::Install.run("local-transmission") - end + Hbc::CLI::Install.run("local-transmission") + Hbc::CLI::Install.run("local-transmission") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed end it "prints a warning message on double install" do - shutup do - Hbc::CLI::Install.run("local-transmission") - end + Hbc::CLI::Install.run("local-transmission") expect { Hbc::CLI::Install.run("local-transmission") }.to output(/Warning: Cask 'local-transmission' is already installed./).to_stderr end it "allows double install with --force" do - shutup do - Hbc::CLI::Install.run("local-transmission") - end + Hbc::CLI::Install.run("local-transmission") expect { expect { @@ -57,19 +47,15 @@ end it "skips dependencies with --skip-cask-deps" do - shutup do - Hbc::CLI::Install.run("with-depends-on-cask-multiple", "--skip-cask-deps") - end + Hbc::CLI::Install.run("with-depends-on-cask-multiple", "--skip-cask-deps") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-depends-on-cask-multiple.rb")).to be_installed expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb")).not_to be_installed expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).not_to be_installed end it "properly handles Casks that are not present" do expect { - shutup do - Hbc::CLI::Install.run("notacask") - end + Hbc::CLI::Install.run("notacask") }.to raise_error(Hbc::CaskError, "Install incomplete.") end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/list_spec.rb
@@ -48,9 +48,7 @@ it "lists the installed files for those Casks" do casks.each(&InstallHelper.method(:install_without_artifacts_with_caskfile)) - shutup do - Hbc::Artifact::App.new(transmission).install_phase - end + Hbc::Artifact::App.new(transmission).install_phase expect { Hbc::CLI::List.run("local-transmission", "local-caffeine")
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/outdated_spec.rb
@@ -10,9 +10,8 @@ end before do - shutup do - installed.each { |cask| InstallHelper.install_with_caskfile(cask) } - end + installed.each { |cask| InstallHelper.install_with_caskfile(cask) } + allow_any_instance_of(described_class).to receive(:verbose?).and_return(true) end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/reinstall_spec.rb
@@ -2,9 +2,7 @@ it "displays the reinstallation progress" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install output = Regexp.new <<-EOS.undent ==> Downloading file:.*caffeine.zip @@ -23,23 +21,18 @@ end it "allows reinstalling a Cask" do - shutup do - Hbc::CLI::Install.run("local-transmission") - end + Hbc::CLI::Install.run("local-transmission") + expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed - shutup do - Hbc::CLI::Reinstall.run("local-transmission") - end + Hbc::CLI::Reinstall.run("local-transmission") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed end it "allows reinstalling a non installed Cask" do expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).not_to be_installed - shutup do - Hbc::CLI::Reinstall.run("local-transmission") - end + Hbc::CLI::Reinstall.run("local-transmission") expect(Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb")).to be_installed end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/search_spec.rb
@@ -75,9 +75,7 @@ end it "highlights installed packages" do - shutup do - Hbc::CLI::Install.run("local-caffeine") - end + Hbc::CLI::Install.run("local-caffeine") expect(Hbc::CLI::Search.highlight_installed("local-caffeine")).to eq(pretty_installed("local-caffeine")) end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/style_spec.rb
@@ -5,9 +5,7 @@ let(:args) { [] } let(:cli) { described_class.new(*args) } - around do |example| - shutup { example.run } - end + around(&:run) describe "#run" do subject { cli.run }
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/uninstall_spec.rb
@@ -2,9 +2,7 @@ it "displays the uninstallation progress" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install output = Regexp.new <<-EOS.undent ==> Uninstalling Cask local-caffeine @@ -30,27 +28,21 @@ it "tries anyway on a non-present Cask when --force is given" do expect { - shutup do - Hbc::CLI::Uninstall.run("local-caffeine", "--force") - end + Hbc::CLI::Uninstall.run("local-caffeine", "--force") }.not_to raise_error end it "can uninstall and unlink multiple Casks at once" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") transmission = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb") - shutup do - Hbc::Installer.new(caffeine).install - Hbc::Installer.new(transmission).install - end + Hbc::Installer.new(caffeine).install + Hbc::Installer.new(transmission).install expect(caffeine).to be_installed expect(transmission).to be_installed - shutup do - Hbc::CLI::Uninstall.run("local-caffeine", "local-transmission") - end + Hbc::CLI::Uninstall.run("local-caffeine", "local-transmission") expect(caffeine).not_to be_installed expect(Hbc.appdir.join("Transmission.app")).not_to exist @@ -61,17 +53,13 @@ it "calls `uninstall` before removing artifacts" do cask = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-uninstall-script-app.rb") - shutup do - Hbc::Installer.new(cask).install - end + Hbc::Installer.new(cask).install expect(cask).to be_installed expect(Hbc.appdir.join("MyFancyApp.app")).to exist expect { - shutup do - Hbc::CLI::Uninstall.run("with-uninstall-script-app") - end + Hbc::CLI::Uninstall.run("with-uninstall-script-app") }.not_to raise_error expect(cask).not_to be_installed @@ -81,24 +69,20 @@ it "can uninstall Casks when the uninstall script is missing, but only when using `--force`" do cask = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-uninstall-script-app.rb") - shutup do - Hbc::Installer.new(cask).install - end + Hbc::Installer.new(cask).install expect(cask).to be_installed Hbc.appdir.join("MyFancyApp.app").rmtree - expect { shutup { Hbc::CLI::Uninstall.run("with-uninstall-script-app") } } + expect { Hbc::CLI::Uninstall.run("with-uninstall-script-app") } .to output(/does not exist/).to_stderr .and raise_error(Hbc::CaskError, "Uninstall incomplete.") expect(cask).to be_installed expect { - shutup do - Hbc::CLI::Uninstall.run("with-uninstall-script-app", "--force") - end + Hbc::CLI::Uninstall.run("with-uninstall-script-app", "--force") }.not_to raise_error expect(cask).not_to be_installed @@ -131,17 +115,13 @@ end it "uninstalls one version at a time" do - shutup do - Hbc::CLI::Uninstall.run("versioned-cask") - end + Hbc::CLI::Uninstall.run("versioned-cask") expect(caskroom_path.join(first_installed_version)).to exist expect(caskroom_path.join(last_installed_version)).not_to exist expect(caskroom_path).to exist - shutup do - Hbc::CLI::Uninstall.run("versioned-cask") - end + Hbc::CLI::Uninstall.run("versioned-cask") expect(caskroom_path.join(first_installed_version)).not_to exist expect(caskroom_path).not_to exist @@ -180,9 +160,7 @@ end it "can still uninstall those Casks" do - shutup do - Hbc::CLI::Uninstall.run("ive-been-renamed") - end + Hbc::CLI::Uninstall.run("ive-been-renamed") expect(app).not_to exist expect(caskroom_path).not_to exist
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli/zap_spec.rb
@@ -9,17 +9,13 @@ caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") transmission = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb") - shutup do - Hbc::Installer.new(caffeine).install - Hbc::Installer.new(transmission).install - end + Hbc::Installer.new(caffeine).install + Hbc::Installer.new(transmission).install expect(caffeine).to be_installed expect(transmission).to be_installed - shutup do - Hbc::CLI::Zap.run("local-caffeine", "local-transmission") - end + Hbc::CLI::Zap.run("local-caffeine", "local-transmission") expect(caffeine).not_to be_installed expect(Hbc.appdir.join("Caffeine.app")).not_to be_a_symlink @@ -33,9 +29,7 @@ # it "dispatches both uninstall and zap stanzas" do # with_zap = Hbc::CaskLoader.load('with-zap') # - # shutup do - # Hbc::Installer.new(with_zap).install - # end + # Hbc::Installer.new(with_zap).install # # with_zap.must_be :installed? # @@ -48,9 +42,8 @@ # Hbc::FakeSystemCommand.expects_command(['/usr/bin/sudo', '-E', '--', '/bin/rm', '-rf', '--', # Pathname.new('~/Library/Preferences/my.fancy.app.plist').expand_path]) # - # shutup do - # Hbc::CLI::Zap.run('with-zap') - # end + # Hbc::CLI::Zap.run('with-zap') + # # with_zap.wont_be :installed? # end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/cli_spec.rb
@@ -17,7 +17,7 @@ cli = described_class.new("--language=en") expect(cli).to receive(:detect_command_and_arguments).with(no_args) expect(cli).to receive(:exit).with(1) - shutup { cli.run } + cli.run end context "when no option is specified" do @@ -36,10 +36,6 @@ allow(noop_command).to receive(:run) end - around do |example| - shutup { example.run } - end - it "passes `--version` along to the subcommand" do version_command = double("CLI::Version") allow(described_class).to receive(:lookup_command).with("--version").and_return(version_command)
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/container/naked_spec.rb
@@ -13,9 +13,7 @@ container = Hbc::Container::Naked.new(cask, path, Hbc::FakeSystemCommand) expect { - shutup do - container.extract - end + container.extract }.not_to raise_error expect(Hbc::FakeSystemCommand.system_calls[expected_command]).to eq(1)
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/depends_on_spec.rb
@@ -3,9 +3,7 @@ describe "Satisfy Dependencies and Requirements", :cask do subject { lambda do - shutup do - Hbc::Installer.new(cask).install - end + Hbc::Installer.new(cask).install end }
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/download_strategy_spec.rb
@@ -23,9 +23,7 @@ it "calls curl with default arguments for a simple Cask" do allow(downloader).to receive(:curl) - shutup do - downloader.fetch - end + downloader.fetch expect(downloader).to have_received(:curl).with( cask.url.to_s, @@ -41,9 +39,7 @@ curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-A", "Mozilla/25.0.1"]) end @@ -56,9 +52,7 @@ curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-A", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10) https://caskroom.github.io"]) end @@ -78,9 +72,7 @@ curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-b", "coo=kie;mon=ster"]) end @@ -93,9 +85,7 @@ curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-e", "http://somehost/also"]) end @@ -124,9 +114,7 @@ curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-d", "form=data"]) expect(curl_args.each_cons(2)).to include(["-d", "is=good"]) @@ -140,9 +128,7 @@ curl_args = [] allow(downloader).to receive(:curl) { |*args| curl_args = args } - shutup do - downloader.fetch - end + downloader.fetch expect(curl_args.each_cons(2)).to include(["-X", "POST"]) end @@ -161,18 +147,14 @@ allow(downloader).to receive(:compress) allow(downloader).to receive(:fetch_repo) - retval = shutup { downloader.fetch } - - expect(retval).to equal(downloader.tarball_path) + expect(downloader.fetch).to equal(downloader.tarball_path) end it "calls fetch_repo with default arguments for a simple Cask" do allow(downloader).to receive(:compress) allow(downloader).to receive(:fetch_repo) - shutup do - downloader.fetch - end + downloader.fetch expect(downloader).to have_received(:fetch_repo).with( downloader.cached_location, @@ -183,9 +165,7 @@ it "calls svn with default arguments for a simple Cask" do allow(downloader).to receive(:compress) - shutup do - downloader.fetch - end + downloader.fetch expect(fake_system_command).to have_received(:run!).with( "/usr/bin/svn", @@ -211,9 +191,7 @@ it "adds svn arguments for :trust_cert" do allow(downloader).to receive(:compress) - shutup do - downloader.fetch - end + downloader.fetch expect(fake_system_command).to have_received(:run!).with( "/usr/bin/svn", @@ -242,9 +220,7 @@ it "adds svn arguments for :revision" do allow(downloader).to receive(:compress) - shutup do - downloader.fetch - end + downloader.fetch expect(fake_system_command).to have_received(:run!).with( "/usr/bin/svn", @@ -269,9 +245,7 @@ downloader.cached_location.mkdir } - shutup do - downloader.fetch - end + downloader.fetch expect(fake_system_command).to have_received(:run!).with( "/usr/bin/tar", @@ -299,7 +273,7 @@ # FileUtils.touch(target.join('empty_file.txt')) # File.utime(1000,1000,target.join('empty_file.txt')) # end - # expect(shutup { downloader.fetch }).to equal(downloader.tarball_path) + # expect(downloader.fetch).to equal(downloader.tarball_path) # d = Hbc::Download.new(cask) # d.send(:_check_sums, downloader.tarball_path, cask.sums) # end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/dsl_spec.rb
@@ -36,9 +36,7 @@ it "will simply warn, not throw an exception" do expect { - shutup do - attempt_unknown_method.call - end + attempt_unknown_method.call }.not_to raise_error end end @@ -78,12 +76,10 @@ it "may use deprecated DSL version hash syntax" do allow(ENV).to receive(:[]).with("HOMEBREW_DEVELOPER").and_return(nil) - shutup do - expect(cask.token).to eq("with-dsl-version") - expect(cask.url.to_s).to eq("http://example.com/TestCask.dmg") - expect(cask.homepage).to eq("http://example.com/") - expect(cask.version.to_s).to eq("1.2.3") - end + expect(cask.token).to eq("with-dsl-version") + expect(cask.url.to_s).to eq("http://example.com/TestCask.dmg") + expect(cask.homepage).to eq("http://example.com/") + expect(cask.version.to_s).to eq("1.2.3") end end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/installer_spec.rb
@@ -7,9 +7,7 @@ it "downloads and installs a nice fresh Cask" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).to be_a_directory expect(Hbc.appdir.join("Caffeine.app")).to be_a_directory @@ -18,9 +16,7 @@ it "works with dmg-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-dmg.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-dmg", asset.version)).to be_a_directory expect(Hbc.appdir.join("container")).to be_a_file @@ -29,9 +25,7 @@ it "works with tar-gz-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-tar-gz.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-tar-gz", asset.version)).to be_a_directory expect(Hbc.appdir.join("container")).to be_a_file @@ -40,9 +34,7 @@ it "works with xar-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-xar.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-xar", asset.version)).to be_a_directory expect(Hbc.appdir.join("container")).to be_a_file @@ -51,9 +43,7 @@ it "works with pure bzip2-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-bzip2.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-bzip2", asset.version)).to be_a_directory expect(Hbc.appdir.join("container-bzip2--#{asset.version}")).to be_a_file @@ -62,9 +52,7 @@ it "works with pure gzip-based Casks" do asset = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-gzip.rb") - shutup do - Hbc::Installer.new(asset).install - end + Hbc::Installer.new(asset).install expect(Hbc.caskroom.join("container-gzip", asset.version)).to be_a_directory expect(Hbc.appdir.join("container")).to be_a_file @@ -73,46 +61,36 @@ it "blows up on a bad checksum" do bad_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/bad-checksum.rb") expect { - shutup do - Hbc::Installer.new(bad_checksum).install - end + Hbc::Installer.new(bad_checksum).install }.to raise_error(Hbc::CaskSha256MismatchError) end it "blows up on a missing checksum" do missing_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/missing-checksum.rb") expect { - shutup do - Hbc::Installer.new(missing_checksum).install - end + Hbc::Installer.new(missing_checksum).install }.to raise_error(Hbc::CaskSha256MissingError) end it "installs fine if sha256 :no_check is used" do no_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/no-checksum.rb") - shutup do - Hbc::Installer.new(no_checksum).install - end + Hbc::Installer.new(no_checksum).install expect(no_checksum).to be_installed end it "fails to install if sha256 :no_check is used with --require-sha" do no_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/no-checksum.rb") expect { - shutup do - Hbc::Installer.new(no_checksum, require_sha: true).install - end + Hbc::Installer.new(no_checksum, require_sha: true).install }.to raise_error(Hbc::CaskNoShasumError) end it "installs fine if sha256 :no_check is used with --require-sha and --force" do no_checksum = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/no-checksum.rb") - shutup do - Hbc::Installer.new(no_checksum, require_sha: true, force: true).install - end + Hbc::Installer.new(no_checksum, require_sha: true, force: true).install expect(no_checksum).to be_installed end @@ -140,9 +118,7 @@ it "does not extract __MACOSX directories from zips" do with_macosx_dir = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/with-macosx-dir.rb") - shutup do - Hbc::Installer.new(with_macosx_dir).install - end + Hbc::Installer.new(with_macosx_dir).install expect(with_macosx_dir.staged_path.join("__MACOSX")).not_to be_a_directory end @@ -152,14 +128,10 @@ expect(with_auto_updates).not_to be_installed - shutup do - Hbc::Installer.new(with_auto_updates).install - end + Hbc::Installer.new(with_auto_updates).install expect { - shutup do - Hbc::Installer.new(with_auto_updates, force: true).install - end + Hbc::Installer.new(with_auto_updates, force: true).install }.not_to raise_error end @@ -171,9 +143,7 @@ installer = Hbc::Installer.new(transmission) - shutup do - installer.install - end + installer.install expect { installer.install @@ -185,51 +155,41 @@ expect(transmission).not_to be_installed - shutup do - Hbc::Installer.new(transmission).install - end + Hbc::Installer.new(transmission).install - shutup do + expect { Hbc::Installer.new(transmission, force: true).install - end # wont_raise + }.not_to raise_error end it "works naked-pkg-based Casks" do naked_pkg = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/container-pkg.rb") - shutup do - Hbc::Installer.new(naked_pkg).install - end + Hbc::Installer.new(naked_pkg).install expect(Hbc.caskroom.join("container-pkg", naked_pkg.version, "container.pkg")).to be_a_file end it "works properly with an overridden container :type" do naked_executable = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/naked-executable.rb") - shutup do - Hbc::Installer.new(naked_executable).install - end + Hbc::Installer.new(naked_executable).install expect(Hbc.caskroom.join("naked-executable", naked_executable.version, "naked_executable")).to be_a_file end it "works fine with a nested container" do nested_app = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/nested-app.rb") - shutup do - Hbc::Installer.new(nested_app).install - end + Hbc::Installer.new(nested_app).install expect(Hbc.appdir.join("MyNestedApp.app")).to be_a_directory end it "generates and finds a timestamped metadata directory for an installed Cask" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install m_path = caffeine.metadata_timestamped_path(timestamp: :now, create: true) expect(caffeine.metadata_timestamped_path(timestamp: :latest)).to eq(m_path) @@ -238,9 +198,7 @@ it "generates and finds a metadata subdirectory for an installed Cask" do caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install subdir_name = "Casks" m_subdir = caffeine.metadata_subdir(subdir_name, timestamp: :now, create: true) @@ -253,10 +211,8 @@ caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") installer = Hbc::Installer.new(caffeine) - shutup do - installer.install - installer.uninstall - end + installer.install + installer.uninstall expect(Hbc.caskroom.join("local-caffeine", caffeine.version, "Caffeine.app")).not_to be_a_directory expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).not_to be_a_directory @@ -267,19 +223,15 @@ caffeine = Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-caffeine.rb") mutated_version = caffeine.version + ".1" - shutup do - Hbc::Installer.new(caffeine).install - end + Hbc::Installer.new(caffeine).install expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).to be_a_directory expect(Hbc.caskroom.join("local-caffeine", mutated_version)).not_to be_a_directory FileUtils.mv(Hbc.caskroom.join("local-caffeine", caffeine.version), Hbc.caskroom.join("local-caffeine", mutated_version)) expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).not_to be_a_directory expect(Hbc.caskroom.join("local-caffeine", mutated_version)).to be_a_directory - shutup do - Hbc::Installer.new(caffeine, force: true).uninstall - end + Hbc::Installer.new(caffeine, force: true).uninstall expect(Hbc.caskroom.join("local-caffeine", caffeine.version)).not_to be_a_directory expect(Hbc.caskroom.join("local-caffeine", mutated_version)).not_to be_a_directory
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/pkg_spec.rb
@@ -88,9 +88,7 @@ allow(pkg).to receive(:root).and_return(fake_root) allow(pkg).to receive(:forget) - shutup do - pkg.uninstall - end + pkg.uninstall expect(fake_dir).to be_a_directory expect(fake_file).not_to be_a_file
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/staged_spec.rb
@@ -6,10 +6,7 @@ let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/"cask/Casks/local-transmission.rb") } let(:installer) { Hbc::Installer.new(cask) } it "fetches the bundle ID from a staged cask" do - shutup do - installer.install - end - + installer.install expect(installer.bundle_identifier).to eq("org.m0k.transmission") end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/system_command_spec.rb
@@ -56,7 +56,7 @@ shared_examples "it returns '1 2 3 4 5 6'" do describe "its result" do - subject { shutup { described_class.run(command, options) } } + subject { described_class.run(command, options) } it { is_expected.to be_a_success } its(:stdout) { is_expected.to eq([1, 3, 5, nil].join("\n")) } @@ -132,7 +132,7 @@ it "returns without deadlocking" do wait(15).for { - shutup { described_class.run(command, options) } + described_class.run(command, options) }.to be_a_success end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cask/verify/checksum_spec.rb
@@ -7,10 +7,6 @@ allow(cask).to receive(:sha256).and_return(sha256) end - around do |example| - shutup { example.run } - end - describe ".me?" do subject { described_class.me?(cask) }
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/checksum_verification_spec.rb
@@ -11,25 +11,21 @@ def formula(&block) describe "#brew" do it "does not raise an error when the checksum matches" do expect { - shutup do - f = formula do - sha256 TESTBALL_SHA256 - end - - f.brew {} + f = formula do + sha256 TESTBALL_SHA256 end + + f.brew {} }.not_to raise_error end it "raises an error when the checksum doesn't match" do expect { - shutup do - f = formula do - sha256 "dcbf5f44743b74add648c7e35e414076632fa3b24463d68d1f6afc5be77024f8" - end - - f.brew {} + f = formula do + sha256 "dcbf5f44743b74add648c7e35e414076632fa3b24463d68d1f6afc5be77024f8" end + + f.brew {} }.to raise_error(ChecksumMismatchError) end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cleanup_spec.rb
@@ -18,19 +18,15 @@ describe "::cleanup" do it "removes .DS_Store files" do - shutup do - described_class.cleanup - end + described_class.cleanup expect(ds_store).not_to exist end it "doesn't remove anything if `--dry-run` is specified" do ARGV << "--dry-run" - shutup do - described_class.cleanup - end + described_class.cleanup expect(ds_store).to exist end @@ -42,14 +38,12 @@ before(:each) do described_class.instance_variable_set(:@unremovable_kegs, []) - shutup do - [f1, f2].each do |f| - f.brew do - f.install - end - - Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write + [f1, f2].each do |f| + f.brew do + f.install end + + Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write end allow_any_instance_of(Keg) @@ -58,12 +52,12 @@ end it "doesn't remove any kegs" do - shutup { described_class.cleanup_formula f2 } + described_class.cleanup_formula f2 expect(f1.installed_kegs.size).to eq(2) end it "lists the unremovable kegs" do - shutup { described_class.cleanup_formula f2 } + described_class.cleanup_formula f2 expect(described_class.unremovable_kegs).to contain_exactly(f1.installed_kegs[0]) end end @@ -89,24 +83,20 @@ version_scheme 2 end.new - shutup do - [f1, f2, f3, f4].each do |f| - f.brew do - f.install - end - - Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write + [f1, f2, f3, f4].each do |f| + f.brew do + f.install end + + Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write end expect(f1).to be_installed expect(f2).to be_installed expect(f3).to be_installed expect(f4).to be_installed - shutup do - described_class.cleanup_formula f3 - end + described_class.cleanup_formula f3 expect(f1).not_to be_installed expect(f2).not_to be_installed @@ -119,9 +109,7 @@ path.mkpath ARGV << "--prune=all" - shutup do - described_class.cleanup_logs - end + described_class.cleanup_logs expect(path).not_to exist end @@ -131,9 +119,7 @@ incomplete = (HOMEBREW_CACHE/"something.incomplete") incomplete.mkpath - shutup do - described_class.cleanup_cache - end + described_class.cleanup_cache expect(incomplete).not_to exist end @@ -142,9 +128,7 @@ java_cache = (HOMEBREW_CACHE/"java_cache") java_cache.mkpath - shutup do - described_class.cleanup_cache - end + described_class.cleanup_cache expect(java_cache).not_to exist end @@ -153,9 +137,7 @@ npm_cache = (HOMEBREW_CACHE/"npm_cache") npm_cache.mkpath - shutup do - described_class.cleanup_cache - end + described_class.cleanup_cache expect(npm_cache).not_to exist end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/analytics_spec.rb
@@ -1,9 +1,7 @@ describe "brew analytics", :integration_test do before(:each) do HOMEBREW_REPOSITORY.cd do - shutup do - system "git", "init" - end + system "git", "init" end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/bundle_spec.rb
@@ -4,10 +4,8 @@ setup_remote_tap "homebrew/bundle" HOMEBREW_REPOSITORY.cd do - shutup do - system "git", "init" - system "git", "commit", "--allow-empty", "-m", "This is a test commit" - end + system "git", "init" + system "git", "commit", "--allow-empty", "-m", "This is a test commit" end mktmpdir do |path|
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/cask_spec.rb
@@ -2,9 +2,8 @@ describe "list" do it "returns a list of installed Casks" do setup_remote_tap("caskroom/cask") - shutup do - expect { brew "cask", "list" }.to be_a_success - end + + expect { brew "cask", "list" }.to be_a_success end end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/desc_spec.rb
@@ -30,9 +30,7 @@ it "creates a description cache" do expect(desc_cache).not_to exist - shutup do - expect { brew "desc", "--description", "testball" }.to be_a_success - end + expect { brew "desc", "--description", "testball" }.to be_a_success expect(desc_cache).to exist end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/fetch_spec.rb
@@ -4,9 +4,7 @@ expect(HOMEBREW_CACHE/"testball-0.1.tbz").not_to exist - shutup do - expect { brew "fetch", "testball" }.to be_a_success - end + expect { brew "fetch", "testball" }.to be_a_success expect(HOMEBREW_CACHE/"testball-0.1.tbz").to exist end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/install_spec.rb
@@ -101,9 +101,7 @@ .and not_to_output.to_stderr .and be_a_success - shutup do - expect { brew "switch", "testball1", "3.0" }.to be_a_success - end + expect { brew "switch", "testball1", "3.0" }.to be_a_success expect { brew "install", "testball1" } .to output(/2.0 is already installed/).to_stderr @@ -156,14 +154,12 @@ repo_path.join("bin").mkpath repo_path.cd do - shutup do - system "git", "init" - system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" - FileUtils.touch "bin/something.bin" - FileUtils.touch "README" - system "git", "add", "--all" - system "git", "commit", "-m", "Initial repo commit" - end + system "git", "init" + system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" + FileUtils.touch "bin/something.bin" + FileUtils.touch "README" + system "git", "add", "--all" + system "git", "commit", "-m", "Initial repo commit" end setup_test_formula "testball1", <<-EOS.undent
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/link_spec.rb
@@ -9,19 +9,15 @@ it "does not fail if the given Formula is already linked" do setup_test_formula "testball1" - shutup do - expect { brew "install", "testball1" }.to be_a_success - expect { brew "link", "testball1" }.to be_a_success - end + expect { brew "install", "testball1" }.to be_a_success + expect { brew "link", "testball1" }.to be_a_success end it "links a given Formula" do setup_test_formula "testball1" - shutup do - expect { brew "install", "testball1" }.to be_a_success - expect { brew "unlink", "testball1" }.to be_a_success - end + expect { brew "install", "testball1" }.to be_a_success + expect { brew "unlink", "testball1" }.to be_a_success expect { brew "link", "--dry-run", "testball1" } .to output(/Would link/).to_stdout @@ -44,9 +40,7 @@ keg_only "just because" EOS - shutup do - expect { brew "install", "testball1" }.to be_a_success - end + expect { brew "install", "testball1" }.to be_a_success expect { brew "link", "testball1", "SHELL" => "/bin/zsh" } .to output(/testball1 is keg-only/).to_stderr
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/log_spec.rb
@@ -1,10 +1,8 @@ describe "brew log", :integration_test do it "shows the Git log for the Homebrew repository when no argument is given" do HOMEBREW_REPOSITORY.cd do - shutup do - system "git", "init" - system "git", "commit", "--allow-empty", "-m", "This is a test commit" - end + system "git", "init" + system "git", "commit", "--allow-empty", "-m", "This is a test commit" end expect { brew "log" } @@ -18,18 +16,15 @@ core_tap = CoreTap.new core_tap.path.cd do - shutup do - system "git", "init" - system "git", "add", "--all" - system "git", "commit", "-m", "This is a test commit for Testball" - end + system "git", "init" + system "git", "add", "--all" + system "git", "commit", "-m", "This is a test commit for Testball" end core_tap_url = "file://#{core_tap.path}" shallow_tap = Tap.fetch("homebrew", "shallow") - shutup do - system "git", "clone", "--depth=1", core_tap_url, shallow_tap.path - end + + system "git", "clone", "--depth=1", core_tap_url, shallow_tap.path expect { brew "log", "#{shallow_tap}/testball" } .to output(/This is a test commit for Testball/).to_stdout
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/outdated_spec.rb
@@ -28,9 +28,7 @@ setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath - shutup do - expect { brew "pin", "testball" }.to be_a_success - end + expect { brew "pin", "testball" }.to be_a_success expect { brew "outdated", "--verbose" } .to output("testball (0.0.1) < 0.1 [pinned at 0.0.1]\n").to_stdout @@ -44,9 +42,7 @@ setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath - shutup do - expect { brew "pin", "testball" }.to be_a_success - end + expect { brew "pin", "testball" }.to be_a_success expected_json = [ {
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/pin_spec.rb
@@ -3,10 +3,8 @@ setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath - shutup do - expect { brew "pin", "testball" }.to be_a_success - expect { brew "upgrade" }.to be_a_success - end + expect { brew "pin", "testball" }.to be_a_success + expect { brew "upgrade" }.to be_a_success expect(HOMEBREW_CELLAR/"testball/0.1").not_to be_a_directory end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/reinstall_spec.rb
@@ -4,9 +4,7 @@ before(:each) do setup_test_formula "testball" - shutup do - expect { brew "install", "testball", "--with-foo" }.to be_a_success - end + expect { brew "install", "testball", "--with-foo" }.to be_a_success end it "reinstalls a Formula" do
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/switch_spec.rb
@@ -14,9 +14,7 @@ keg_only "just because" EOS - shutup do - expect { brew "install", "testball" }.to be_a_success - end + expect { brew "install", "testball" }.to be_a_success testball_rack = HOMEBREW_CELLAR/"testball" FileUtils.cp_r testball_rack/"0.1", testball_rack/"0.2"
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/uninstall_spec.rb
@@ -2,9 +2,7 @@ describe "brew uninstall", :integration_test do it "uninstalls a given Formula" do - shutup do - expect { brew "install", testball }.to be_a_success - end + expect { brew "install", testball }.to be_a_success expect { brew "uninstall", "--force", testball } .to output(/Uninstalling testball/).to_stdout
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/unlink_spec.rb
@@ -2,9 +2,7 @@ it "unlinks a Formula" do setup_test_formula "testball" - shutup do - expect { brew "install", "testball" }.to be_a_success - end + expect { brew "install", "testball" }.to be_a_success expect { brew "unlink", "--dry-run", "testball" } .to output(/Would remove/).to_stdout
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/unpack_spec.rb
@@ -3,10 +3,8 @@ setup_test_formula "testball" mktmpdir do |path| - shutup do - expect { brew "unpack", "testball", "--destdir=#{path}" } - .to be_a_success - end + expect { brew "unpack", "testball", "--destdir=#{path}" } + .to be_a_success expect(path/"testball-0.1").to be_a_directory end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/unpin_spec.rb
@@ -3,11 +3,9 @@ setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath - shutup do - expect { brew "pin", "testball" }.to be_a_success - expect { brew "unpin", "testball" }.to be_a_success - expect { brew "upgrade" }.to be_a_success - end + expect { brew "pin", "testball" }.to be_a_success + expect { brew "unpin", "testball" }.to be_a_success + expect { brew "upgrade" }.to be_a_success expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/cmd/upgrade_spec.rb
@@ -3,9 +3,7 @@ setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath - shutup do - expect { brew "upgrade" }.to be_a_success - end + expect { brew "upgrade" }.to be_a_success expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/dev-cmd/audit_spec.rb
@@ -174,13 +174,11 @@ class Foo < Formula specify "GithubGistFormula", :needs_compat do ENV.delete("HOMEBREW_DEVELOPER") - fa = shutup do - formula_auditor "foo", <<-EOS.undent - class Foo < GithubGistFormula - url "http://example.com/foo-1.0.tgz" - end - EOS - end + fa = formula_auditor "foo", <<-EOS.undent + class Foo < GithubGistFormula + url "http://example.com/foo-1.0.tgz" + end + EOS fa.audit_class expect(fa.problems) @@ -388,18 +386,14 @@ class Foo#{@foo_version} < Formula origin_tap_path.mkpath origin_tap_path.cd do - shutup do - system "git", "init" - system "git", "add", "--all" - system "git", "commit", "-m", "init" - end + system "git", "init" + system "git", "add", "--all" + system "git", "commit", "-m", "init" end tap_path.mkpath tap_path.cd do - shutup do - system "git", "clone", origin_tap_path, "." - end + system "git", "clone", origin_tap_path, "." end end @@ -423,16 +417,12 @@ def formula_gsub_commit(before, after = "") origin_formula_path.write text origin_tap_path.cd do - shutup do - system "git", "commit", "-am", "commit" - end + system "git", "commit", "-am", "commit" end tap_path.cd do - shutup do - system "git", "fetch" - system "git", "reset", "--hard", "origin/master" - end + system "git", "fetch" + system "git", "reset", "--hard", "origin/master" end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/dev-cmd/bottle_spec.rb
@@ -1,10 +1,8 @@ describe "brew bottle", :integration_test do it "builds a bottle for the given Formula" do begin - shutup do - expect { brew "install", "--build-bottle", testball } - .to be_a_success - end + expect { brew "install", "--build-bottle", testball } + .to be_a_success expect { brew "bottle", "--no-rebuild", testball } .to output(/Formula not from core or any taps/).to_stderr
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/dev-cmd/create_spec.rb
@@ -3,9 +3,7 @@ let(:formula_file) { CoreTap.new.formula_dir/"testball.rb" } it "creates a new Formula file for a given URL" do - shutup do - brew "create", url, "HOMEBREW_EDITOR" => "/bin/cat" - end + brew "create", url, "HOMEBREW_EDITOR" => "/bin/cat" expect(formula_file).to exist expect(formula_file.read).to match(%Q(sha256 "#{TESTBALL_SHA256}"))
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/dev-cmd/edit_spec.rb
@@ -1,9 +1,7 @@ describe "brew edit", :integration_test do it "opens a given Formula in an editor" do HOMEBREW_REPOSITORY.cd do - shutup do - system "git", "init" - end + system "git", "init" end setup_test_formula "testball"
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/dev-cmd/pull_spec.rb
@@ -8,10 +8,8 @@ it "fetches a patch from a GitHub commit or pull request and applies it", :needs_network do CoreTap.instance.path.cd do - shutup do - system "git", "init" - system "git", "checkout", "-b", "new-branch" - end + system "git", "init" + system "git", "checkout", "-b", "new-branch" end expect { brew "pull", "https://jenkins.brew.sh/job/Homebrew\%20Testing/1028/" }
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/dev-cmd/tap_spec.rb
@@ -3,13 +3,11 @@ path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo" path.mkpath path.cd do - shutup do - system "git", "init" - system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" - FileUtils.touch "readme" - system "git", "add", "--all" - system "git", "commit", "-m", "init" - end + system "git", "init" + system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" + FileUtils.touch "readme" + system "git", "add", "--all" + system "git", "commit", "-m", "init" end expect { brew "tap" }
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/dev-cmd/test_spec.rb
@@ -14,9 +14,7 @@ end it "fails when a Formula has no test" do - shutup do - expect { brew "install", testball }.to be_a_success - end + expect { brew "install", testball }.to be_a_success expect { brew "test", testball } .to output(/testball defines no test/).to_stderr @@ -39,9 +37,7 @@ end EOS - shutup do - expect { brew "install", "testball" }.to be_a_success - end + expect { brew "install", "testball" }.to be_a_success expect { brew "test", "--HEAD", "testball" } .to output(/Testing testball/).to_stdout
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/download_strategies_spec.rb
@@ -147,18 +147,14 @@ end def git_commit_all - shutup do - system "git", "add", "--all" - system "git", "commit", "-m", "commit number #{@commit_id}" - @commit_id += 1 - end + system "git", "add", "--all" + system "git", "commit", "-m", "commit number #{@commit_id}" + @commit_id += 1 end def setup_git_repo - shutup do - system "git", "init" - system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" - end + system "git", "init" + system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" FileUtils.touch "README" git_commit_all end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/formula_installer_bottle_spec.rb
@@ -17,9 +17,7 @@ def temporarily_install_bottle(formula) expect(formula).to be_bottled expect(formula).to pour_bottle - shutup do - described_class.new(formula).install - end + described_class.new(formula).install keg = Keg.new(formula.prefix)
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/formula_installer_spec.rb
@@ -18,9 +18,7 @@ def temporary_install(formula) installer = described_class.new(formula) - shutup do - installer.install - end + installer.install keg = Keg.new(formula.prefix)
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/formula_spec.rb
@@ -582,11 +582,9 @@ cached_location.cd do FileUtils.touch "LICENSE" - shutup do - system("git", "init") - system("git", "add", "--all") - system("git", "commit", "-m", "Initial commit") - end + system("git", "init") + system("git", "add", "--all") + system("git", "commit", "-m", "Initial commit") end f.update_head_version @@ -786,11 +784,9 @@ def test version_scheme(2) end.new - shutup do - [f1, f2, f3, f4].each do |f| - f.brew { f.install } - Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write - end + [f1, f2, f3, f4].each do |f| + f.brew { f.install } + Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write end expect(f1).to be_installed @@ -806,18 +802,16 @@ def test f2 = Class.new(Testball) { version("0.2") }.new f3 = Class.new(Testball) { version("0.3") }.new - shutup do - f1.brew { f1.install } - f1.pin - f2.brew { f2.install } - f3.brew { f3.install } - end + f1.brew { f1.install } + f1.pin + f2.brew { f2.install } + f3.brew { f3.install } expect(f1.prefix).to eq((HOMEBREW_PINNED_KEGS/f1.name).resolved_path) expect(f1).to be_installed expect(f2).to be_installed expect(f3).to be_installed - expect(shutup { f3.eligible_kegs_for_cleanup }).to eq([Keg.new(f2.prefix)]) + expect(f3.eligible_kegs_for_cleanup).to eq([Keg.new(f2.prefix)]) end specify "with HEAD installed" do @@ -1204,11 +1198,9 @@ def reset_outdated_kegs testball_repo.cd do FileUtils.touch "LICENSE" - shutup do - system("git", "init") - system("git", "add", "--all") - system("git", "commit", "-m", "Initial commit") - end + system("git", "init") + system("git", "add", "--all") + system("git", "commit", "-m", "Initial commit") end expect(f.outdated_kegs(fetch_head: true)).not_to be_empty
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/formulary_spec.rb
@@ -84,10 +84,7 @@ class Wrong#{subject.class_s(formula_name)} < Formula end it "returns a Formula when given a URL" do - formula = shutup do - subject.factory("file://#{formula_path}") - end - + formula = subject.factory("file://#{formula_path}") expect(formula).to be_kind_of(Formula) end @@ -112,19 +109,15 @@ class Wrong#{subject.class_s(formula_name)} < Formula let(:installer) { FormulaInstaller.new(formula) } it "returns a Formula when given a rack" do - shutup do - installer.install - end + installer.install f = subject.from_rack(formula.rack) expect(f).to be_kind_of(Formula) expect(f.build).to be_kind_of(Tab) end it "returns a Formula when given a Keg" do - shutup do - installer.install - end + installer.install keg = Keg.new(formula.prefix) f = subject.from_keg(keg) @@ -206,9 +199,7 @@ class Wrong#{subject.class_s(formula_name)} < Formula it "prioritizes Formulae from pinned Taps" do begin tap.pin - formula = shutup do - subject.find_with_priority(formula_name) - end + formula = subject.find_with_priority(formula_name) expect(formula).to be_kind_of(Formula) expect(formula.path).to eq(tap_path.realpath) ensure
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/language/go_spec.rb
@@ -7,9 +7,7 @@ expect(described_class).to receive(:opoo).once mktmpdir do |path| - shutup do - described_class.stage_deps [], path - end + described_class.stage_deps [], path end end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/migrator_spec.rb
@@ -81,9 +81,7 @@ specify "#move_to_new_directory" do keg.unlink - shutup do - subject.move_to_new_directory - end + subject.move_to_new_directory expect(new_keg_record).to be_a_directory expect(new_keg_record/"bin").to be_a_directory @@ -117,9 +115,7 @@ expect(HOMEBREW_LINKED_KEGS.children.count).to eq(1) expect((HOMEBREW_PREFIX/"opt").children.count).to eq(1) - shutup do - subject.unlink_oldname - end + subject.unlink_oldname expect(HOMEBREW_LINKED_KEGS).not_to exist expect(HOMEBREW_LIBRARY/"bin").not_to exist @@ -134,9 +130,7 @@ FileUtils.touch new_keg_record/"bin"/file end - shutup do - subject.link_newname - end + subject.link_newname expect(HOMEBREW_LINKED_KEGS.children.count).to eq(1) expect((HOMEBREW_PREFIX/"opt").children.count).to eq(1) @@ -172,9 +166,7 @@ tab.source["path"] = old_formula.path.to_s tab.write - shutup do - subject.migrate - end + subject.migrate expect(new_keg_record).to exist expect(old_keg_record.parent).to be_a_symlink
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/missing_formula_spec.rb
@@ -148,13 +148,11 @@ (tap_path/"deleted-formula.rb").write "placeholder" tap_path.cd do - shutup do - system "git", "init" - system "git", "add", "--all" - system "git", "commit", "-m", "initial state" - system "git", "rm", "deleted-formula.rb" - system "git", "commit", "-m", "delete formula 'deleted-formula'" - end + system "git", "init" + system "git", "add", "--all" + system "git", "commit", "-m", "initial state" + system "git", "rm", "deleted-formula.rb" + system "git", "commit", "-m", "delete formula 'deleted-formula'" end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/patching_spec.rb
@@ -21,38 +21,32 @@ def formula(name = "formula_name", path: Formulary.core_path(name), spec: :stabl matcher :be_patched do match do |formula| - shutup do - formula.brew do - formula.patch - s = File.read("libexec/NOOP") - expect(s).not_to include("NOOP"), "libexec/NOOP was not patched as expected" - expect(s).to include("ABCD"), "libexec/NOOP was not patched as expected" - end + formula.brew do + formula.patch + s = File.read("libexec/NOOP") + expect(s).not_to include("NOOP"), "libexec/NOOP was not patched as expected" + expect(s).to include("ABCD"), "libexec/NOOP was not patched as expected" end end end matcher :be_sequentially_patched do match do |formula| - shutup do - formula.brew do - formula.patch - s = File.read("libexec/NOOP") - expect(s).not_to include("NOOP"), "libexec/NOOP was not patched as expected" - expect(s).not_to include("ABCD"), "libexec/NOOP was not patched as expected" - expect(s).to include("1234"), "libexec/NOOP was not patched as expected" - end + formula.brew do + formula.patch + s = File.read("libexec/NOOP") + expect(s).not_to include("NOOP"), "libexec/NOOP was not patched as expected" + expect(s).not_to include("ABCD"), "libexec/NOOP was not patched as expected" + expect(s).to include("1234"), "libexec/NOOP was not patched as expected" end end end matcher :miss_apply do match do |formula| expect { - shutup do - formula.brew do - formula.patch - end + formula.brew do + formula.patch end }.to raise_error(MissingApplyError) end @@ -128,32 +122,28 @@ def patches specify "single_patch_dsl_with_incorrect_strip" do expect { - shutup do - f = formula do - patch :p0 do - url PATCH_URL_A - sha256 PATCH_A_SHA256 - end + f = formula do + patch :p0 do + url PATCH_URL_A + sha256 PATCH_A_SHA256 end - - f.brew { |formula, _staging| formula.patch } end + + f.brew { |formula, _staging| formula.patch } }.to raise_error(ErrorDuringExecution) end specify "single_patch_dsl_with_incorrect_strip_with_apply" do expect { - shutup do - f = formula do - patch :p0 do - url TESTBALL_PATCHES_URL - sha256 TESTBALL_PATCHES_SHA256 - apply APPLY_A - end + f = formula do + patch :p0 do + url TESTBALL_PATCHES_URL + sha256 TESTBALL_PATCHES_SHA256 + apply APPLY_A end - - f.brew { |formula, _staging| formula.patch } end + + f.brew { |formula, _staging| formula.patch } }.to raise_error(ErrorDuringExecution) end @@ -261,17 +251,15 @@ def patches specify "single_patch_dsl_with_apply_enoent_fail" do expect { - shutup do - f = formula do - patch do - url TESTBALL_PATCHES_URL - sha256 TESTBALL_PATCHES_SHA256 - apply "patches/#{APPLY_A}" - end + f = formula do + patch do + url TESTBALL_PATCHES_URL + sha256 TESTBALL_PATCHES_SHA256 + apply "patches/#{APPLY_A}" end - - f.brew { |formula, _staging| formula.patch } end + + f.brew { |formula, _staging| formula.patch } }.to raise_error(ErrorDuringExecution) end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/resource_spec.rb
@@ -126,9 +126,7 @@ expect(fn).to receive(:verify_checksum).and_raise(ChecksumMissingError) expect(fn).to receive(:sha256) - shutup do - subject.verify_download_integrity(fn) - end + subject.verify_download_integrity(fn) end specify "#verify_download_integrity_mismatch" do @@ -138,10 +136,8 @@ expect(fn).to receive(:verify_checksum).with(checksum) .and_raise(ChecksumMismatchError.new(fn, checksum, Object.new)) - shutup do - expect { - subject.verify_download_integrity(fn) - }.to raise_error(ChecksumMismatchError) - end + expect { + subject.verify_download_integrity(fn) + }.to raise_error(ChecksumMismatchError) end end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/sandbox_spec.rb
@@ -37,11 +37,9 @@ describe "#exec" do it "fails when writing to file not specified with ##allow_write" do - shutup do - expect { - subject.exec "touch", file - }.to raise_error(ErrorDuringExecution) - end + expect { + subject.exec "touch", file + }.to raise_error(ErrorDuringExecution) expect(file).not_to exist end
true
Other
Homebrew
brew
2ad3a87045246f89aa267251315d660f663c42f2.json
Silence all specs by default.
Library/Homebrew/test/spec_helper.rb
@@ -19,7 +19,6 @@ require "global" require "tap" -require "test/support/helper/shutup" require "test/support/helper/fixtures" require "test/support/helper/formula" require "test/support/helper/mktmpdir" @@ -44,7 +43,6 @@ config.filter_run_when_matching :focus - config.include(Test::Helper::Shutup) config.include(Test::Helper::Fixtures) config.include(Test::Helper::Formula) config.include(Test::Helper::MkTmpDir) @@ -88,11 +86,25 @@ def find_files @__argv = ARGV.dup @__env = ENV.to_hash # dup doesn't work on ENV + unless example.metadata.key?(:focus) || ENV.key?("VERBOSE_TESTS") + @__stdout = $stdout.clone + @__stderr = $stderr.clone + $stdout.reopen(File::NULL) + $stderr.reopen(File::NULL) + end + example.run ensure ARGV.replace(@__argv) ENV.replace(@__env) + unless example.metadata.key?(:focus) || ENV.key?("VERBOSE_TESTS") + $stdout.reopen(@__stdout) + $stderr.reopen(@__stderr) + @__stdout.close + @__stderr.close + end + Tab.clear_cache FileUtils.rm_rf [
true