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
3abfdc9e8012fb7d36010237323a054306a1ea83.json
Convert Dependency test to spec.
Library/Homebrew/test/dependency_test.rb
@@ -1,131 +0,0 @@ -require "testing_env" -require "dependency" - -class DependableTests < Homebrew::TestCase - def setup - super - @tags = ["foo", "bar", :build] - @dep = Struct.new(:tags).new(@tags).extend(Dependable) - end - - def test_options - assert_equal %w[--foo --bar].sort, @dep.options.as_flags....
true
Other
Homebrew
brew
8bea5de173a279cd094b1551760b67f4ba21aa7b.json
Convert Cleaner test to spec.
Library/Homebrew/test/cleaner_spec.rb
@@ -0,0 +1,224 @@ +require "cleaner" +require "formula" + +describe Cleaner do + include FileUtils + + subject { described_class.new(f) } + let(:f) { formula("cleaner_test") { url "foo-1.0" } } + + before(:each) do + f.prefix.mkpath + end + + describe "#clean" do + it "cleans files" do + f.bin.mkpath +...
true
Other
Homebrew
brew
8bea5de173a279cd094b1551760b67f4ba21aa7b.json
Convert Cleaner test to spec.
Library/Homebrew/test/cleaner_test.rb
@@ -1,220 +0,0 @@ -require "testing_env" -require "cleaner" -require "formula" - -class CleanerTests < Homebrew::TestCase - include FileUtils - - def setup - super - @f = formula("cleaner_test") { url "foo-1.0" } - @f.prefix.mkpath - end - - def test_clean_file - @f.bin.mkpath - @f.lib.mkpath - cp...
true
Other
Homebrew
brew
25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0.json
Install tap command completions and manpages Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
Library/Homebrew/cmd/list.rb
@@ -77,6 +77,7 @@ def list lib/ruby/site_ruby/[12].* lib/ruby/vendor_ruby/[12].* manpages/brew.1 + manpages/brew-cask.1 share/pypy/* share/pypy3/* share/info/dir
true
Other
Homebrew
brew
25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0.json
Install tap command completions and manpages Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
Library/Homebrew/cmd/tap.rb
@@ -38,7 +38,7 @@ module Homebrew def tap if ARGV.include? "--repair" - Tap.each(&:link_manpages) + Tap.each(&:link_completions_and_manpages) elsif ARGV.include? "--list-official" require "official_taps" puts OFFICIAL_TAPS.map { |t| "homebrew/#{t}" }
true
Other
Homebrew
brew
25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0.json
Install tap command completions and manpages Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
Library/Homebrew/cmd/update-report.rb
@@ -104,8 +104,8 @@ def update_report puts if ARGV.include?("--preinstall") end - link_completions_and_docs - Tap.each(&:link_manpages) + link_completions_manpages_and_docs + Tap.each(&:link_completions_and_manpages) Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"] @@ -281,7 +2...
true
Other
Homebrew
brew
25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0.json
Install tap command completions and manpages Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
Library/Homebrew/tap.rb
@@ -236,7 +236,7 @@ def install(options = {}) raise end - link_manpages + link_completions_and_manpages formula_count = formula_files.size puts "Tapped #{formula_count} formula#{plural(formula_count, "e")} (#{path.abv})" unless quiet @@ -254,8 +254,10 @@ def install(options = {}) EO...
true
Other
Homebrew
brew
25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0.json
Install tap command completions and manpages Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
Library/Homebrew/test/tap_test.rb
@@ -60,9 +60,18 @@ class Foo < Formula @cmd_file.parent.mkpath touch @cmd_file chmod 0755, @cmd_file - @manpage_file = @path/"man/man1/brew-tap-cmd.1" + @manpage_file = @path/"manpages/brew-tap-cmd.1" @manpage_file.parent.mkpath touch @manpage_file + @bash_completion_file = @path/"comp...
true
Other
Homebrew
brew
25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0.json
Install tap command completions and manpages Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
Library/Homebrew/utils.rb
@@ -9,6 +9,7 @@ require "utils/github" require "utils/hash" require "utils/inreplace" +require "utils/link" require "utils/popen" require "utils/tty" require "time" @@ -481,38 +482,6 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {}) out end -def link_src_dst_dirs(src_dir, dst_dir, command...
true
Other
Homebrew
brew
25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0.json
Install tap command completions and manpages Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
Library/Homebrew/utils/link.rb
@@ -0,0 +1,70 @@ +module Utils + module Link + module_function + + def link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false) + return unless src_dir.exist? + conflicts = [] + src_paths = link_dir ? [src_dir] : src_dir.find + src_paths.each do |src| + next if src.directory? && !...
true
Other
Homebrew
brew
e3f4701f385c286a2cc72c5d07870cc9a6ce0bf4.json
audit: fix audit on formulae without homepages
Library/Homebrew/dev-cmd/audit.rb
@@ -605,6 +605,11 @@ def audit_desc def audit_homepage homepage = formula.homepage + if homepage.nil? || homepage.empty? + problem "Formula should have a homepage." + return + end + unless homepage =~ %r{^https?://} problem "The homepage should start with http or https (URL is #{ho...
true
Other
Homebrew
brew
e3f4701f385c286a2cc72c5d07870cc9a6ce0bf4.json
audit: fix audit on formulae without homepages
Library/Homebrew/test/audit_test.rb
@@ -466,6 +466,17 @@ class #{Formulary.class_s(name)} < Formula end end + def test_audit_without_homepage + fa = formula_auditor "foo", <<-EOS.undent, online: true + class Foo < Formula + url "http://example.com/foo-1.0.tgz" + end + EOS + + fa.audit_homepage + assert_match "Formu...
true
Other
Homebrew
brew
9ce757b339d0fbda95c6dcc07d07dc33b08dad8a.json
Remove unused utils/homebrew_vars.
Library/Homebrew/utils/homebrew_vars.rb
@@ -1,11 +0,0 @@ -#!/usr/bin/env ruby - -ENV.keys.each do |key| - if key =~ /^HOMEBREW.*/ - # Remove any HOMEBREW.* vars containing white-space which causes a problem for "env -i" command via string. - # - # (Any user supplied HOMEBREW.* vars with valid white-space need to be hard-coded in 'bin/brew') - #...
false
Other
Homebrew
brew
177aefdf555488653572f1f98bf4d6d8c7a03671.json
xcodebuild audit: match xcodebuild with no args Closes #2199. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Library/Homebrew/dev-cmd/audit.rb
@@ -924,7 +924,7 @@ def audit_text end end - if text =~ /xcodebuild[ (]["'*]/ && !text.include?("SYMROOT=") + if text =~ /xcodebuild[ (]*["'*]*/ && !text.include?("SYMROOT=") problem 'xcodebuild should be passed an explicit "SYMROOT"' end
true
Other
Homebrew
brew
177aefdf555488653572f1f98bf4d6d8c7a03671.json
xcodebuild audit: match xcodebuild with no args Closes #2199. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Library/Homebrew/test/audit_test.rb
@@ -465,4 +465,38 @@ class #{Formulary.class_s(name)} < Formula end end end + + def test_audit_xcodebuild_suggests_symroot + fa = formula_auditor "foo", <<-EOS.undent + class Foo < Formula + url "http://example.com/foo-1.0.tgz" + homepage "http://example.com" + + def install...
true
Other
Homebrew
brew
2826aa4c7f9b6d8c9ebac30c084160e10365ef55.json
Convert BuildOptions test to spec.
Library/Homebrew/test/build_options_spec.rb
@@ -0,0 +1,52 @@ +require "build_options" +require "options" + +RSpec::Matchers.alias_matcher :be_built_with, :be_with +RSpec::Matchers.alias_matcher :be_built_without, :be_without + +describe BuildOptions do + subject { described_class.new(args, opts) } + let(:bad_build) { described_class.new(bad_args, opts) } + le...
true
Other
Homebrew
brew
2826aa4c7f9b6d8c9ebac30c084160e10365ef55.json
Convert BuildOptions test to spec.
Library/Homebrew/test/build_options_test.rb
@@ -1,50 +0,0 @@ -require "testing_env" -require "build_options" -require "options" - -class BuildOptionsTests < Homebrew::TestCase - def setup - super - args = Options.create(%w[--with-foo --with-bar --without-qux]) - opts = Options.create(%w[--with-foo --with-bar --without-baz --without-qux]) - @build = ...
true
Other
Homebrew
brew
2826aa4c7f9b6d8c9ebac30c084160e10365ef55.json
Convert BuildOptions test to spec.
Library/Homebrew/test/tab_spec.rb
@@ -1,7 +1,7 @@ require "tab" require "formula" -RSpec::Matchers.alias_matcher :have_option_with, :be_with +RSpec::Matchers.alias_matcher :be_built_with, :be_with describe Tab do matcher :be_poured_from_bottle do @@ -80,10 +80,10 @@ end specify "#with?" do - expect(subject).to have_option_with("foo...
true
Other
Homebrew
brew
ac2cafe13914881d6db72c57e007ccaa7a6a0e04.json
Convert Caveats test to spec.
Library/Homebrew/test/caveats_spec.rb
@@ -0,0 +1,29 @@ +require "formula" +require "caveats" + +describe Caveats do + subject { described_class.new(f) } + let(:f) { formula { url "foo-1.0" } } + + specify "#f" do + expect(subject.f).to eq(f) + end + + describe "#empty?" do + it "returns true if the Formula has no caveats" do + expect(subjec...
true
Other
Homebrew
brew
ac2cafe13914881d6db72c57e007ccaa7a6a0e04.json
Convert Caveats test to spec.
Library/Homebrew/test/caveats_test.rb
@@ -1,30 +0,0 @@ -require "testing_env" -require "formula" -require "caveats" - -class CaveatsTests < Homebrew::TestCase - def setup - super - @f = formula { url "foo-1.0" } - @c = Caveats.new @f - end - - def test_f - assert_equal @f, @c.f - end - - def test_empty? - assert @c.empty? - - f = for...
true
Other
Homebrew
brew
37f7e84e04051af769f13dda3b0d400802446a7f.json
Convert Options test to spec.
Library/Homebrew/test/options_spec.rb
@@ -0,0 +1,148 @@ +require "options" + +describe Option do + subject { described_class.new("foo") } + + specify "#to_s" do + expect(subject.to_s).to eq("--foo") + end + + specify "equality" do + foo = Option.new("foo") + bar = Option.new("bar") + expect(subject).to eq(foo) + expect(subject).not_to eq...
true
Other
Homebrew
brew
37f7e84e04051af769f13dda3b0d400802446a7f.json
Convert Options test to spec.
Library/Homebrew/test/options_test.rb
@@ -1,148 +0,0 @@ -require "testing_env" -require "options" - -class OptionTests < Homebrew::TestCase - def setup - super - @option = Option.new("foo") - end - - def test_to_s - assert_equal "--foo", @option.to_s - end - - def test_equality - foo = Option.new("foo") - bar = Option.new("bar") - as...
true
Other
Homebrew
brew
8ef45eb896d5f440019bd34dfcf4d0ed0ff4f253.json
README: add FX Coudert.
README.md
@@ -40,7 +40,8 @@ This is our PGP key which is valid until May 24, 2017. ## Who Are You? Homebrew's lead maintainer is [Mike McQuaid](https://github.com/mikemcquaid). -Homebrew's current maintainers are [Alyssa Ross](https://github.com/alyssais), [Andrew Janke](https://github.com/apjanke), [Baptiste Fontaine](https...
true
Other
Homebrew
brew
8ef45eb896d5f440019bd34dfcf4d0ed0ff4f253.json
README: add FX Coudert.
docs/brew.1.html
@@ -791,7 +791,7 @@ <h2 id="AUTHORS">AUTHORS</h2> <p>Homebrew's lead maintainer is Mike McQuaid.</p> -<p>Homebrew's current maintainers are Alyssa Ross, Andrew Janke, Baptiste Fontaine, Alex Dunn, ilovezfs, Josh Hagins, JCount, Misty De Meo, Tomasz Pajor, Markus Reiter, Tim Smith, Tom Schoonjans, Uladzislau Shabli...
true
Other
Homebrew
brew
8ef45eb896d5f440019bd34dfcf4d0ed0ff4f253.json
README: add FX Coudert.
manpages/brew.1
@@ -1056,7 +1056,7 @@ Homebrew Documentation: \fIhttps://github\.com/Homebrew/brew/blob/master/docs/\f Homebrew\'s lead maintainer is Mike McQuaid\. . .P -Homebrew\'s current maintainers are Alyssa Ross, Andrew Janke, Baptiste Fontaine, Alex Dunn, ilovezfs, Josh Hagins, JCount, Misty De Meo, Tomasz Pajor, Markus Rei...
true
Other
Homebrew
brew
b0cd1c732d25b112e75facf48325f7841c8b6ac3.json
Convert Formula test to spec.
Library/Homebrew/test/formula_spec.rb
@@ -0,0 +1,1295 @@ +require "test/support/fixtures/testball" +require "formula" + +RSpec::Matchers.alias_matcher :follow_installed_alias, :be_follow_installed_alias +RSpec::Matchers.alias_matcher :have_any_version_installed, :be_any_version_installed +RSpec::Matchers.alias_matcher :need_migration, :be_migration_needed ...
true
Other
Homebrew
brew
b0cd1c732d25b112e75facf48325f7841c8b6ac3.json
Convert Formula test to spec.
Library/Homebrew/test/formula_test.rb
@@ -1,1205 +0,0 @@ -require "testing_env" -require "test/support/fixtures/testball" -require "formula" - -class FormulaTests < Homebrew::TestCase - def test_formula_instantiation - klass = Class.new(Formula) { url "http://example.com/foo-1.0.tar.gz" } - name = "formula_name" - path = Formulary.core_path(name)...
true
Other
Homebrew
brew
b0cd1c732d25b112e75facf48325f7841c8b6ac3.json
Convert Formula test to spec.
Library/Homebrew/test/formulary_spec.rb
@@ -216,4 +216,12 @@ class Wrong#{subject.class_s(formula_name)} < Formula end end end + + describe "::core_path" do + it "returns the path to a Formula in the core tap" do + name = "foo-bar" + expect(subject.core_path(name)) + .to eq(Pathname.new("#{HOMEBREW_LIBRARY}/Taps/homebrew/h...
true
Other
Homebrew
brew
e03caebaedf579d5330c5c908b2d3ffa927ea5c3.json
Convert Tab test to spec.
Library/Homebrew/test/tab_spec.rb
@@ -0,0 +1,341 @@ +require "tab" +require "formula" + +RSpec::Matchers.alias_matcher :have_option_with, :be_with + +describe Tab do + matcher :be_poured_from_bottle do + match do |actual| + actual.poured_from_bottle == true + end + end + + matcher :be_built_as_bottle do + match do |actual| + actua...
true
Other
Homebrew
brew
e03caebaedf579d5330c5c908b2d3ffa927ea5c3.json
Convert Tab test to spec.
Library/Homebrew/test/tab_test.rb
@@ -1,318 +0,0 @@ -require "testing_env" -require "tab" -require "formula" - -class TabTests < Homebrew::TestCase - def setup - super - - @time = Time.now.to_i - @used = Options.create(%w[--with-foo --without-bar]) - @unused = Options.create(%w[--with-baz --without-qux]) - - @tab = Tab.new( - "home...
true
Other
Homebrew
brew
890631dc29cbf0035566d5c5d1e74ddf43684bc2.json
Convert ENV test to spec.
Library/Homebrew/test/ARGV_spec.rb
@@ -1,7 +1,7 @@ require "extend/ARGV" describe HomebrewArgvExtension do - subject { argv.extend(HomebrewArgvExtension) } + subject { argv.extend(described_class) } let(:argv) { ["mxcl"] } describe "#formulae" do
true
Other
Homebrew
brew
890631dc29cbf0035566d5c5d1e74ddf43684bc2.json
Convert ENV test to spec.
Library/Homebrew/test/ENV_spec.rb
@@ -0,0 +1,189 @@ +require "extend/ENV" + +shared_examples EnvActivation do + subject { env.extend(described_class) } + let(:env) { {}.extend(EnvActivation) } + + it "supports switching compilers" do + subject.clang + expect(subject["LD"]).to be nil + expect(subject["CC"]).to eq(subject["OBJC"]) + end + + ...
true
Other
Homebrew
brew
890631dc29cbf0035566d5c5d1e74ddf43684bc2.json
Convert ENV test to spec.
Library/Homebrew/test/ENV_test.rb
@@ -1,175 +0,0 @@ -require "testing_env" -require "extend/ENV" -require "testing_env" - -module SharedEnvTests - def setup - super - @env = {}.extend(EnvActivation) - end - - def test_switching_compilers - @env.clang - assert_nil @env["LD"] - assert_equal @env["OBJC"], @env["CC"] - end - - def test_...
true
Other
Homebrew
brew
004e8175c6ceb58f026e79e6bbd0ddac9e8380f6.json
Add `formula` spec helper.
Library/Homebrew/test/spec_helper.rb
@@ -16,6 +16,7 @@ require "test/support/helper/shutup" require "test/support/helper/fixtures" +require "test/support/helper/formula" require "test/support/helper/spec/shared_context/integration_test" TEST_DIRECTORIES = [ @@ -32,6 +33,7 @@ config.order = :random config.include(Test::Helper::Shutup) conf...
true
Other
Homebrew
brew
004e8175c6ceb58f026e79e6bbd0ddac9e8380f6.json
Add `formula` spec helper.
Library/Homebrew/test/support/helper/formula.rb
@@ -0,0 +1,19 @@ +require "formulary" + +module Test + module Helper + module Formula + def formula(name = "formula_name", path: Formulary.core_path(name), spec: :stable, alias_path: nil, &block) + Class.new(::Formula, &block).new(name, path, spec, alias_path: alias_path) + end + + # Use a stu...
true
Other
Homebrew
brew
af65b07ac944082f5c9a84803690189e403b854a.json
Convert `patching` test to spec.
Library/Homebrew/test/patching_spec.rb
@@ -0,0 +1,289 @@ +require "formula" + +describe "patching" do + TESTBALL_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz".freeze + TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz".freeze + PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff".freeze + PATCH...
true
Other
Homebrew
brew
af65b07ac944082f5c9a84803690189e403b854a.json
Convert `patching` test to spec.
Library/Homebrew/test/patching_test.rb
@@ -1,248 +0,0 @@ -require "testing_env" -require "formula" - -class PatchingTests < Homebrew::TestCase - TESTBALL_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz".freeze - TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz".freeze - PATCH_URL_A = "file://#{TEST_FIXTURE_...
true
Other
Homebrew
brew
95aa8869a957ea81b1b8ab7485adb0229b12c3e9.json
Add William Woodruff, JCount to maintainers lists
README.md
@@ -40,7 +40,7 @@ This is our PGP key which is valid until May 24, 2017. ## Who Are You? Homebrew's lead maintainer is [Mike McQuaid](https://github.com/mikemcquaid). -Homebrew's current maintainers are [Misty De Meo](https://github.com/mistydemeo), [Andrew Janke](https://github.com/apjanke), [Tomasz Pajor](https:/...
true
Other
Homebrew
brew
95aa8869a957ea81b1b8ab7485adb0229b12c3e9.json
Add William Woodruff, JCount to maintainers lists
docs/brew.1.html
@@ -791,7 +791,7 @@ <h2 id="AUTHORS">AUTHORS</h2> <p>Homebrew's lead maintainer is Mike McQuaid.</p> -<p>Homebrew's current maintainers are Misty De Meo, Andrew Janke, Tomasz Pajor, Josh Hagins, Baptiste Fontaine, Markus Reiter, ilovezfs, Tom Schoonjans, Uladzislau Shablinski, Tim Smith and Alex Dunn.</p> +<p>Home...
true
Other
Homebrew
brew
95aa8869a957ea81b1b8ab7485adb0229b12c3e9.json
Add William Woodruff, JCount to maintainers lists
manpages/brew.1
@@ -1056,7 +1056,7 @@ Homebrew Documentation: \fIhttps://github\.com/Homebrew/brew/blob/master/docs/\f Homebrew\'s lead maintainer is Mike McQuaid\. . .P -Homebrew\'s current maintainers are Misty De Meo, Andrew Janke, Tomasz Pajor, Josh Hagins, Baptiste Fontaine, Markus Reiter, ilovezfs, Tom Schoonjans, Uladzislau ...
true
Other
Homebrew
brew
9a47205b0eb7b016989259de9238223854eed2ed.json
README: add Netlify link.
README.md
@@ -73,6 +73,10 @@ Our bottles (binary packages) are hosted by [Bintray](https://bintray.com/homebr [![Downloads by Bintray](https://bintray.com/docs/images/downloads_by_bintray_96.png)](https://bintray.com/homebrew) +[Our website](https://brew.sh) is hosted by [Netlify](https://www.netlify.com). + +[![Deploys by ...
false
Other
Homebrew
brew
56a0afe5792d398d1682426bbebb1e53346b34d5.json
Extend #ds_file? in Pathname
Library/Homebrew/extend/pathname.rb
@@ -457,6 +457,10 @@ def install_metafiles(from = Pathname.pwd) end end + def ds_store? + basename.to_s == ".DS_Store" + end + # https://bugs.ruby-lang.org/issues/9915 if RUBY_VERSION == "2.0.0" prepend Module.new {
true
Other
Homebrew
brew
56a0afe5792d398d1682426bbebb1e53346b34d5.json
Extend #ds_file? in Pathname
Library/Homebrew/test/pathname_test.rb
@@ -166,6 +166,11 @@ def test_cp_path_sub_directory @dir.cp_path_sub @src, @dst assert_predicate @dst/@dir.basename, :directory? end + + def test_ds_store + refute_predicate @file, :ds_store? + assert_predicate @src/".DS_Store", :ds_store? + end end class PathnameInstallTests < Homebrew::TestCa...
true
Other
Homebrew
brew
7f8cd184936e3419a5bf960121f76098505d6811.json
Convert `brew create` test to spec.
Library/Homebrew/test/create_test.rb
@@ -1,12 +0,0 @@ -require "testing_env" - -class IntegrationCommandTestCreate < IntegrationCommandTestCase - def test_create - url = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" - cmd("create", url, "HOMEBREW_EDITOR" => "/bin/cat") - - formula_file = CoreTap.new.formula_dir/"testball.rb" - assert...
true
Other
Homebrew
brew
7f8cd184936e3419a5bf960121f76098505d6811.json
Convert `brew create` test to spec.
Library/Homebrew/test/dev-cmd/create_spec.rb
@@ -0,0 +1,13 @@ +describe "brew create", :integration_test do + let(:url) { "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" } + 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" => "/...
true
Other
Homebrew
brew
0248b5e357de99654b6a2f4ee5fd20829c8481e6.json
Convert `brew test` test to spec.
Library/Homebrew/test/dev-cmd/test_spec.rb
@@ -0,0 +1,56 @@ +describe "brew test", :integration_test do + it "fails when no argument is given" do + expect { brew "test" } + .to output(/This command requires a formula argument/).to_stderr + .and not_to_output.to_stdout + .and be_a_failure + end + + it "fails when a Formula is not installed" ...
true
Other
Homebrew
brew
0248b5e357de99654b6a2f4ee5fd20829c8481e6.json
Convert `brew test` test to spec.
Library/Homebrew/test/test_formula_test.rb
@@ -1,30 +0,0 @@ -require "testing_env" - -class IntegrationCommandTestTestFormula < IntegrationCommandTestCase - def test_test_formula - assert_match "This command requires a formula argument", cmd_fail("test") - assert_match "Testing requires the latest version of testball", - cmd_fail("test", testball) -...
true
Other
Homebrew
brew
be2645b04f3b001069daf353289a19155afaf00c.json
Convert `brew options` test to spec.
Library/Homebrew/test/cmd/options_spec.rb
@@ -0,0 +1,12 @@ +describe "brew options", :integration_test do + it "prints a given Formula's options" do + setup_test_formula "testball", <<-EOS.undent + depends_on "bar" => :recommended + EOS + + expect { brew "options", "testball" } + .to output("--with-foo\n\tBuild with foo\n--without-bar\n\tBu...
true
Other
Homebrew
brew
be2645b04f3b001069daf353289a19155afaf00c.json
Convert `brew options` test to spec.
Library/Homebrew/test/options_test.rb
@@ -1,17 +1,5 @@ require "testing_env" require "options" -require "testing_env" - -class IntegrationCommandTestOptions < IntegrationCommandTestCase - def test_options - setup_test_formula "testball", <<-EOS.undent - depends_on "bar" => :recommended - EOS - - assert_equal "--with-foo\n\tBuild with foo\n...
true
Other
Homebrew
brew
c37dbb79b669fc0c4088415d7269a6618f1ccb3c.json
Convert `brew help` test to spec.
Library/Homebrew/test/cmd/help_spec.rb
@@ -0,0 +1,47 @@ +describe "brew", :integration_test do + it "prints help when no argument is given" do + expect { brew } + .to output(/Example usage:\n/).to_stderr + .and be_a_failure + end + + describe "help" do + it "prints help" do + expect { brew "help" } + .to output(/Example usage:...
true
Other
Homebrew
brew
c37dbb79b669fc0c4088415d7269a6618f1ccb3c.json
Convert `brew help` test to spec.
Library/Homebrew/test/help_test.rb
@@ -1,21 +0,0 @@ -require "testing_env" - -class IntegrationCommandTestHelp < IntegrationCommandTestCase - def test_help - assert_match "Example usage:\n", - cmd_fail # Generic help (empty argument list). - assert_match "Unknown command: command-that-does-not-exist", - cmd_fail("h...
true
Other
Homebrew
brew
be498acf4fee38912a497b26e2beed97ee1f8b9a.json
Convert `brew unpack` test to spec.
Library/Homebrew/test/cmd/unpack_spec.rb
@@ -0,0 +1,16 @@ +describe "brew unpack", :integration_test do + it "unpacks a given Formula's archive" do + setup_test_formula "testball" + + Dir.mktmpdir do |path| + path = Pathname.new(path) + + shutup do + expect { brew "unpack", "testball", "--destdir=#{path}" } + .to be_a_success ...
true
Other
Homebrew
brew
be498acf4fee38912a497b26e2beed97ee1f8b9a.json
Convert `brew unpack` test to spec.
Library/Homebrew/test/unpack_test.rb
@@ -1,13 +0,0 @@ -require "testing_env" - -class IntegrationCommandTestUnpack < IntegrationCommandTestCase - def test_unpack - setup_test_formula "testball" - - mktmpdir do |path| - cmd "unpack", "testball", "--destdir=#{path}" - assert File.directory?("#{path}/testball-0.1"), - "The tarball sho...
true
Other
Homebrew
brew
5bf70805d8c134174dfb55791c25066239d9bc0e.json
Convert `brew linkapps` test to spec.
Library/Homebrew/test/cmd/linkapps_spec.rb
@@ -0,0 +1,24 @@ +describe "brew linkapps", :integration_test do + let(:home_dir) { @home_dir = Pathname.new(Dir.mktmpdir) } + let(:apps_dir) { home_dir/"Applications" } + + after(:each) do + home_dir.rmtree unless @home_dir.nil? + end + + it "symlinks applications" do + apps_dir.mkpath + + setup_test_for...
true
Other
Homebrew
brew
5bf70805d8c134174dfb55791c25066239d9bc0e.json
Convert `brew linkapps` test to spec.
Library/Homebrew/test/linkapps_test.rb
@@ -1,15 +0,0 @@ -require "testing_env" - -class IntegrationCommandTestLinkapps < IntegrationCommandTestCase - def test_linkapps - home_dir = Pathname.new(mktmpdir) - (home_dir/"Applications").mkpath - - setup_test_formula "testball" - - source_dir = HOMEBREW_CELLAR/"testball/0.1/TestBall.app" - source_...
true
Other
Homebrew
brew
1d7fde515b9cce2e3fc4dddce1c34f5e410bca87.json
Update deps_spec descriptions
Library/Homebrew/test/deps_spec.rb
@@ -8,19 +8,19 @@ EOS end - it "outputs nothing for formula foo" do + it "outputs no dependencies for a Formula that has no dependencies" do expect { brew "deps", "foo" }.to output("").to_stdout .and not_to_output.to_stderr .and be_a_success end - it "outputs foo for formula bar" do...
false
Other
Homebrew
brew
5e9057500419d1a2b41efe784e9f12ae232e7f6e.json
audit: handle redirects in get_content_details.
Library/Homebrew/dev-cmd/audit.rb
@@ -1542,12 +1542,16 @@ def problem(text) def get_content_details(url) out = {} output, = curl_output "--connect-timeout", "15", "--include", url - split = output.partition("\r\n\r\n") - headers = split.first - out[:status] = headers[%r{HTTP\/.* (\d+)}, 1] + status_code = :unknown + while st...
false
Other
Homebrew
brew
d4df9d44e09df6197275113b266df2b7d51a0339.json
Exclude executables from metafiles Exclude executables in #empty_installation? to avoid 'Empty Installation' error when only executable which name is the same as one of metafiles is installed.
Library/Homebrew/keg.rb
@@ -208,6 +208,7 @@ def ==(other) def empty_installation? Pathname.glob("#{path}/**/*") do |file| + return false if file.executable? next if file.directory? basename = file.basename.to_s next if Metafiles.copy?(basename)
false
Other
Homebrew
brew
ca4fba99c417437aca2efb36cc3c89e871d5f5a0.json
Convert CompilerSelector test to spec.
Library/Homebrew/test/compiler_selector_spec.rb
@@ -0,0 +1,122 @@ +require "compilers" +require "software_spec" + +describe CompilerSelector do + subject { described_class.new(software_spec, versions, compilers) } + let(:compilers) { [:clang, :gcc, :llvm, :gnu] } + let(:software_spec) { SoftwareSpec.new } + let(:cc) { :clang } + let(:versions) do + double( +...
true
Other
Homebrew
brew
ca4fba99c417437aca2efb36cc3c89e871d5f5a0.json
Convert CompilerSelector test to spec.
Library/Homebrew/test/compiler_selector_test.rb
@@ -1,117 +0,0 @@ -require "testing_env" -require "compilers" -require "software_spec" - -class CompilerSelectorTests < Homebrew::TestCase - class Double < SoftwareSpec - def <<(cc) - fails_with(cc) - self - end - end - - class CompilerVersions - attr_accessor :gcc_4_0_build_version, :gcc_build_ve...
true
Other
Homebrew
brew
85ff9add185fc24d99b296cf9cca3071b6d865c0.json
Convert Pathname test to spec.
Library/Homebrew/test/pathname_spec.rb
@@ -0,0 +1,300 @@ +require "tmpdir" +require "extend/pathname" +require "install_renamed" + +describe Pathname do + include FileUtils + + let(:src) { Pathname.new(Dir.mktmpdir) } + let(:dst) { Pathname.new(Dir.mktmpdir) } + let(:file) { src/"foo" } + let(:dir) { src/"bar" } + + after(:each) { rm_rf [src, dst] } +...
true
Other
Homebrew
brew
85ff9add185fc24d99b296cf9cca3071b6d865c0.json
Convert Pathname test to spec.
Library/Homebrew/test/pathname_test.rb
@@ -1,263 +0,0 @@ -require "testing_env" -require "tmpdir" -require "extend/pathname" -require "install_renamed" - -module PathnameTestExtension - include FileUtils - - def setup - super - @src = Pathname.new(mktmpdir) - @dst = Pathname.new(mktmpdir) - @file = @src/"foo" - @dir = @src/"bar" - end -...
true
Other
Homebrew
brew
e793e526611ca4cbc6d0155af8c596c4e826fc41.json
Revert "formula_versions: handle uncommitted formulae."
Library/Homebrew/formula_versions.rb
@@ -15,7 +15,6 @@ def initialize(formula, options = {}) @repository = formula.tap.path @entry_name = @path.relative_path_from(repository).to_s @max_depth = options[:max_depth] - @current_formula = formula end def rev_list(branch) @@ -65,33 +64,25 @@ def version_attributes_map(attributes, branc...
false
Other
Homebrew
brew
7393485b7b2f15b84506d1c7f7d157db545aa18f.json
Convert `dependency_expansion` test to spec.
Library/Homebrew/test/dependency_expansion_spec.rb
@@ -0,0 +1,136 @@ +require "dependency" + +describe Dependency do + def build_dep(name, tags = [], deps = []) + dep = described_class.new(name.to_s, tags) + allow(dep).to receive(:to_formula).and_return(double(deps: deps, name: name)) + dep + end + + let(:foo) { build_dep(:foo) } + let(:bar) { build_dep(:b...
true
Other
Homebrew
brew
7393485b7b2f15b84506d1c7f7d157db545aa18f.json
Convert `dependency_expansion` test to spec.
Library/Homebrew/test/dependency_expansion_test.rb
@@ -1,138 +0,0 @@ -require "testing_env" -require "dependency" - -class DependencyExpansionTests < Homebrew::TestCase - def build_dep(name, tags = [], deps = []) - dep = Dependency.new(name.to_s, tags) - dep.stubs(:to_formula).returns(stub(deps: deps, name: name)) - dep - end - - def setup - super - @...
true
Other
Homebrew
brew
babc375372df635c023977de9f1279a7689e2453.json
Convert Resource test to spec.
Library/Homebrew/test/resource_spec.rb
@@ -0,0 +1,147 @@ +require "resource" + +describe Resource do + subject { described_class.new("test") } + + describe "#url" do + it "sets the URL" do + subject.url("foo") + expect(subject.url).to eq("foo") + end + + it "can set the URL with specifications" do + subject.url("foo", branch: "mast...
true
Other
Homebrew
brew
babc375372df635c023977de9f1279a7689e2453.json
Convert Resource test to spec.
Library/Homebrew/test/resource_test.rb
@@ -1,133 +0,0 @@ -require "testing_env" -require "resource" - -class ResourceTests < Homebrew::TestCase - def setup - super - @resource = Resource.new("test") - end - - def test_url - @resource.url("foo") - assert_equal "foo", @resource.url - end - - def test_url_with_specs - @resource.url("foo", b...
true
Other
Homebrew
brew
f7151e589fec5cd8caef00798c02e0c54eff5419.json
Convert JavaRequirement test to spec.
Library/Homebrew/test/java_requirement_spec.rb
@@ -0,0 +1,107 @@ +require "requirements/java_requirement" + +describe JavaRequirement do + subject { described_class.new([]) } + + before(:each) do + ENV["JAVA_HOME"] = nil + end + + describe "#message" do + its(:message) { is_expected.to match(/Java is required to install this formula./) } + end + + descr...
true
Other
Homebrew
brew
f7151e589fec5cd8caef00798c02e0c54eff5419.json
Convert JavaRequirement test to spec.
Library/Homebrew/test/java_requirement_test.rb
@@ -1,50 +0,0 @@ -require "testing_env" -require "requirements/java_requirement" - -class JavaRequirementTests < Homebrew::TestCase - def setup - super - ENV["JAVA_HOME"] = nil - end - - def test_message - a = JavaRequirement.new([]) - assert_match(/Java is required to install this formula./, a.message) ...
true
Other
Homebrew
brew
69f361089c8c4793b9aad532c13331a1f09ff92a.json
Convert Migrator test to spec.
Library/Homebrew/test/migrator_spec.rb
@@ -0,0 +1,264 @@ +require "migrator" +require "test/support/fixtures/testball" +require "tab" +require "keg" + +describe Migrator do + subject { described_class.new(new_formula) } + + let(:new_formula) { Testball.new("newname") } + let(:old_formula) { Testball.new("oldname") } + + let(:new_keg_record) { HOMEBREW_C...
true
Other
Homebrew
brew
69f361089c8c4793b9aad532c13331a1f09ff92a.json
Convert Migrator test to spec.
Library/Homebrew/test/migrator_test.rb
@@ -1,251 +0,0 @@ -require "testing_env" -require "migrator" -require "test/support/fixtures/testball" -require "tab" -require "keg" - -class Formula - attr_writer :oldname -end - -class MigratorErrorsTests < Homebrew::TestCase - def setup - super - @new_f = Testball.new("newname") - @new_f.oldname = "oldnam...
true
Other
Homebrew
brew
42bb19a6317172804cd149024115f6973fa2fd4f.json
formula_installer: detect recursive dependencies. Detect recursive dependencies and refuse to install them providing instruction on exactly what is depending on what. Fixes #1933.
Library/Homebrew/formula_installer.rb
@@ -151,6 +151,28 @@ def check_install_sanity recursive_deps = formula.recursive_dependencies recursive_formulae = recursive_deps.map(&:to_formula) + recursive_dependencies = [] + recursive_formulae.each do |dep| + dep_recursive_dependencies = dep.recursive_dependencies.map(&:to_s) + if dep_...
false
Other
Homebrew
brew
8bb46baebbc0694130b86483705bfef2c159704e.json
Add RSpec support for integration commands.
Library/Homebrew/test/spec_helper.rb
@@ -16,6 +16,7 @@ require "test/support/helper/shutup" require "test/support/helper/fixtures" +require "test/support/helper/spec/shared_context/integration_test" TEST_DIRECTORIES = [ CoreTap.instance.path/"Formula",
true
Other
Homebrew
brew
8bb46baebbc0694130b86483705bfef2c159704e.json
Add RSpec support for integration commands.
Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
@@ -0,0 +1,94 @@ +require "rspec" +require "open3" + +RSpec::Matchers.define_negated_matcher :not_to_output, :output +RSpec::Matchers.define_negated_matcher :be_a_failure, :be_a_success + +RSpec.shared_context "integration test" do + extend RSpec::Matchers::DSL + + matcher :be_a_success do + match do |actual| + ...
true
Other
Homebrew
brew
22042797d3111316e977eeee6f70439ae41448f6.json
Convert FormulaLock test to spec.
Library/Homebrew/test/formula_lock_spec.rb
@@ -0,0 +1,34 @@ +require "formula_lock" + +describe FormulaLock do + subject { described_class.new("foo") } + + describe "#lock" do + it "does not raise an error when already locked" do + subject.lock + + expect { subject.lock }.not_to raise_error + end + + it "raises an error if a lock already ex...
true
Other
Homebrew
brew
22042797d3111316e977eeee6f70439ae41448f6.json
Convert FormulaLock test to spec.
Library/Homebrew/test/formula_lock_test.rb
@@ -1,23 +0,0 @@ -require "testing_env" -require "formula_lock" - -class FormulaLockTests < Homebrew::TestCase - def setup - super - @lock = FormulaLock.new("foo") - @lock.lock - end - - def teardown - @lock.unlock - super - end - - def test_locking_file_with_existing_lock_raises_error - assert_r...
true
Other
Homebrew
brew
df7ae5eb26a9552ff61c66ed5680c701bf0be7df.json
Use the env block
Library/Homebrew/requirements/ruby_requirement.rb
@@ -8,11 +8,10 @@ def initialize(tags) super end - satisfy build_env: false do - found_ruby = rubies.detect { |ruby| suitable?(ruby) } - return unless found_ruby - ENV.prepend_path "PATH", found_ruby.dirname - found_ruby + satisfy build_env: false { suitable_ruby } + + env do + ENV.prepend_p...
false
Other
Homebrew
brew
423f22df0033f83a04a9452d2e755a96e830b039.json
Convert `search_remote_tap` test to spec.
Library/Homebrew/test/cmd/search_remote_tap_spec.rb
@@ -0,0 +1,19 @@ +require "cmd/search" + +describe Homebrew do + specify "#search_tap" do + json_response = { + "tree" => [ + { + "path" => "Formula/not-a-formula.rb", + "type" => "blob", + }, + ], + } + + allow(GitHub).to receive(:open).and_yield(json_response) + + ...
true
Other
Homebrew
brew
423f22df0033f83a04a9452d2e755a96e830b039.json
Convert `search_remote_tap` test to spec.
Library/Homebrew/test/search_remote_tap_test.rb
@@ -1,19 +0,0 @@ -require "testing_env" -require "cmd/search" - -class SearchRemoteTapTests < Homebrew::TestCase - def test_search_remote_tap - json_response = { - "tree" => [ - { - "path" => "Formula/not-a-formula.rb", - "type" => "blob", - }, - ], - } - - GitHub.stu...
true
Other
Homebrew
brew
9fc14e663bc52b5e32a4c2d07ed6114b99fcbf54.json
Convert GPG2Requirement test to spec.
Library/Homebrew/test/gpg2_requirement_spec.rb
@@ -0,0 +1,23 @@ +require "requirements/gpg2_requirement" +require "fileutils" + +describe GPG2Requirement do + let(:dir) { @dir = Pathname.new(Dir.mktmpdir) } + + after(:each) do + FileUtils.rm_rf dir unless @dir.nil? + end + + describe "#satisfied?" do + it "returns true if GPG2 is installed" do + ENV[...
true
Other
Homebrew
brew
9fc14e663bc52b5e32a4c2d07ed6114b99fcbf54.json
Convert GPG2Requirement test to spec.
Library/Homebrew/test/gpg2_requirement_test.rb
@@ -1,25 +0,0 @@ -require "testing_env" -require "requirements/gpg2_requirement" -require "fileutils" - -class GPG2RequirementTests < Homebrew::TestCase - def setup - super - @dir = Pathname.new(mktmpdir) - (@dir/"bin/gpg").write <<-EOS.undent - #!/bin/bash - echo 2.0.30 - EOS - FileUtils.chmo...
true
Other
Homebrew
brew
1be7852493cee7f7af9b31cef4547aca23bebb0b.json
Convert SoftwareSpec test to spec.
Library/Homebrew/test/software_spec_spec.rb
@@ -0,0 +1,184 @@ +require "software_spec" + +RSpec::Matchers.alias_matcher :have_defined_resource, :be_resource_defined +RSpec::Matchers.alias_matcher :have_defined_option, :be_option_defined + +describe SoftwareSpec do + let(:owner) { double(name: "some_name", full_name: "some_name", tap: "homebrew/core") } + + des...
true
Other
Homebrew
brew
1be7852493cee7f7af9b31cef4547aca23bebb0b.json
Convert SoftwareSpec test to spec.
Library/Homebrew/test/software_spec_test.rb
@@ -1,184 +0,0 @@ -require "testing_env" -require "software_spec" - -class SoftwareSpecTests < Homebrew::TestCase - def setup - super - @spec = SoftwareSpec.new - end - - def test_resource - @spec.resource("foo") { url "foo-1.0" } - assert @spec.resource_defined?("foo") - end - - def test_raises_when_d...
true
Other
Homebrew
brew
9c1db3c820f715f62f550ba1e54f16f9b89bc6ed.json
Convert JavaRequirement test to spec.
Library/Homebrew/test/os/mac/java_requirement_spec.rb
@@ -0,0 +1,34 @@ +require "requirements/java_requirement" +require "fileutils" + +describe JavaRequirement do + subject { described_class.new(%w[1.8]) } + let(:java_home) { Dir.mktmpdir } + let(:java_home_path) { Pathname.new(java_home) } + + before(:each) do + FileUtils.mkdir java_home_path/"bin" + FileUtils...
true
Other
Homebrew
brew
9c1db3c820f715f62f550ba1e54f16f9b89bc6ed.json
Convert JavaRequirement test to spec.
Library/Homebrew/test/os/mac/java_requirement_test.rb
@@ -1,31 +0,0 @@ -require "testing_env" -require "requirements/java_requirement" -require "fileutils" - -class OSMacJavaRequirementTests < Homebrew::TestCase - def setup - super - @java_req = JavaRequirement.new(%w[1.8]) - @tmp_java_home = mktmpdir - @tmp_pathname = Pathname.new(@tmp_java_home) - FileUt...
true
Other
Homebrew
brew
1ff6846218367fc73736039d668b319acebd8cae.json
Convert StringInreplaceExtension test to spec.
Library/Homebrew/test/inreplace_spec.rb
@@ -0,0 +1,251 @@ +require "extend/string" +require "tempfile" +require "utils/inreplace" + +describe StringInreplaceExtension do + subject { string.extend(described_class) } + + describe "#change_make_var!" do + context "flag" do + context "with spaces" do + let(:string) do + <<-EOS.undent + ...
true
Other
Homebrew
brew
1ff6846218367fc73736039d668b319acebd8cae.json
Convert StringInreplaceExtension test to spec.
Library/Homebrew/test/inreplace_test.rb
@@ -1,119 +0,0 @@ -require "testing_env" -require "extend/string" -require "utils/inreplace" - -class InreplaceTest < Homebrew::TestCase - def test_change_make_var - # Replace flag - s1 = "OTHER=def\nFLAG = abc\nFLAG2=abc" - s1.extend(StringInreplaceExtension) - s1.change_make_var! "FLAG", "def" - asser...
true
Other
Homebrew
brew
9904eae48a5e4129905b48e5fe61afbb82726a39.json
Convert FormulaPin test to spec.
Library/Homebrew/test/formula_pin_spec.rb
@@ -0,0 +1,41 @@ +require "formula_pin" + +describe FormulaPin do + subject { described_class.new(formula) } + let(:name) { "double" } + let(:formula) { double(Formula, name: name, rack: HOMEBREW_CELLAR/name) } + + before(:each) do + formula.rack.mkpath + + allow(formula).to receive(:installed_prefixes) do + ...
true
Other
Homebrew
brew
9904eae48a5e4129905b48e5fe61afbb82726a39.json
Convert FormulaPin test to spec.
Library/Homebrew/test/formula_pin_test.rb
@@ -1,51 +0,0 @@ -require "testing_env" -require "formula_pin" - -class FormulaPinTests < Homebrew::TestCase - class FormulaDouble - def name - "double" - end - - def rack - HOMEBREW_CELLAR/name - end - - def installed_prefixes - rack.directory? ? rack.subdirs : [] - end - - def ins...
true
Other
Homebrew
brew
8e0940cc2f79def7f19c01dc2a9429cf624f0c6e.json
Convert Formulary test to spec.
Library/Homebrew/test/formulary_spec.rb
@@ -0,0 +1,219 @@ +require "formula" +require "formula_installer" +require "utils/bottles" + +describe Formulary do + let(:formula_name) { "testball_bottle" } + let(:formula_path) { CoreTap.new.formula_dir/"#{formula_name}.rb" } + let(:formula_content) do + <<-EOS.undent + class #{subject.class_s(formula_nam...
true
Other
Homebrew
brew
8e0940cc2f79def7f19c01dc2a9429cf624f0c6e.json
Convert Formulary test to spec.
Library/Homebrew/test/formulary_test.rb
@@ -1,189 +0,0 @@ -require "testing_env" -require "formula" -require "formula_installer" -require "utils/bottles" - -class FormularyTest < Homebrew::TestCase - def test_class_naming - assert_equal "ShellFm", Formulary.class_s("shell.fm") - assert_equal "Fooxx", Formulary.class_s("foo++") - assert_equal "SLang...
true
Other
Homebrew
brew
c667a43b9790be9887bf3f175d9e6ab3dad80e1a.json
audit: fix insecure mirror check when stdout is empty
Library/Homebrew/dev-cmd/audit.rb
@@ -1499,7 +1499,7 @@ def check_insecure_mirror(url) secure_url = url.sub "http", "https" secure_details = get_content_details(secure_url) - return if !details[:status].start_with?("2") || !secure_details[:status].start_with?("2") + return if details[:status].nil? || secure_details[:status].nil? || !d...
false
Other
Homebrew
brew
81a760921320b6508458d6cdbe4c73b3e01b14b3.json
bump-formula-pr: improve duplicate detection Reduce the chance of false flagging by making sure that the existing pr surfaced by GitHub.issues_for_formula actually contains the exact formula name in its title.
Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -80,7 +80,8 @@ def formula_version(formula, spec, contents = nil) def fetch_pull_requests(formula) GitHub.issues_for_formula(formula.name, tap: formula.tap).select do |pr| - pr["html_url"].include?("/pull/") + pr["html_url"].include?("/pull/") && + /(^|\s)#{Regexp.quote(formula.name)}(:|\s...
false
Other
Homebrew
brew
dfa2c247e0dbdbf506f5175a1c839bfd09caecd9.json
keg: simplify code, handle exceptions.
Library/Homebrew/keg.rb
@@ -239,9 +239,7 @@ def optlinked? def remove_opt_record opt_record.unlink - aliases.each do |a| - (opt_record.parent/a).unlink - end + aliases.each { |a| (opt_record.parent/a).unlink } opt_record.parent.rmdir_if_possible end @@ -465,12 +463,9 @@ def remove_oldname_opt_record end ...
false
Other
Homebrew
brew
14ef15f591795c517b7771c5eb01863b2b577a46.json
keg: create symlinks in opt for formula aliases
Library/Homebrew/keg.rb
@@ -239,6 +239,11 @@ def optlinked? def remove_opt_record opt_record.unlink + unless aliases.empty? + aliases.each do |a| + (opt_record.parent/a).unlink + end + end opt_record.parent.rmdir_if_possible end @@ -461,9 +466,25 @@ def remove_oldname_opt_record @oldname_opt_rec...
false
Other
Homebrew
brew
f33efbe7c46d4a148af00c83dff73c14717ed0d1.json
Convert LanguageModuleRequirement test to spec.
Library/Homebrew/test/language_module_requirement_spec.rb
@@ -0,0 +1,49 @@ +require "requirements/language_module_requirement" + +describe LanguageModuleRequirement do + specify "unique dependencies are not equal" do + x = described_class.new(:node, "less") + y = described_class.new(:node, "coffee-script") + expect(x).not_to eq(y) + expect(x.hash).not_to eq(y.has...
true
Other
Homebrew
brew
f33efbe7c46d4a148af00c83dff73c14717ed0d1.json
Convert LanguageModuleRequirement test to spec.
Library/Homebrew/test/language_module_requirement_test.rb
@@ -1,55 +0,0 @@ -require "testing_env" -require "requirements/language_module_requirement" - -class LanguageModuleRequirementTests < Homebrew::TestCase - parallelize_me! - - def assert_deps_fail(spec) - refute_predicate LanguageModuleRequirement.new(*spec.shift.reverse), :satisfied? - end - - def assert_deps_pa...
true
Other
Homebrew
brew
f33efbe7c46d4a148af00c83dff73c14717ed0d1.json
Convert LanguageModuleRequirement test to spec.
Library/Homebrew/test/spec_helper.rb
@@ -33,6 +33,10 @@ if example.metadata[:needs_macos] skip "not on macOS" unless OS.mac? end + + if example.metadata[:needs_python] + skip "Python not installed." unless which("python") + end end config.around(:each) do |example| begin
true
Other
Homebrew
brew
81d105d9a4cbdba1072c3828d173dcaac4bcc2a6.json
Convert String test to spec.
Library/Homebrew/test/string_spec.rb
@@ -0,0 +1,49 @@ +require "extend/string" + +describe String do + describe "#undent" do + it "removes leading whitespace, taking the first line as reference" do + string = <<-EOS.undent + hi +........my friend over + there + EOS + + expect(string).to eq("hi\n........my friend over\n ...
true
Other
Homebrew
brew
81d105d9a4cbdba1072c3828d173dcaac4bcc2a6.json
Convert String test to spec.
Library/Homebrew/test/string_test.rb
@@ -1,40 +0,0 @@ -require "testing_env" -require "extend/string" - -class StringTest < Homebrew::TestCase - def test_undent - undented = <<-EOS.undent - hi -....my friend over - there - EOS - assert_equal "hi\n....my friend over\nthere\n", undented - end - - def test_undent_not_indented - undented ...
true