aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMike McQuaid2017-05-07 17:31:09 +0100
committerGitHub2017-05-07 17:31:09 +0100
commit0d5956948e597efd4186fbc590fa664f9ed6f429 (patch)
treec7f61167ec6e0599a16a80986acafd2da1938b0b /Library/Homebrew/test
parent8d948e4b0b55912c592d34cb5ea83c649b1f9d5e (diff)
parent57db2e539eaa5fbae351963265312bd24ed08f6b (diff)
downloadbrew-0d5956948e597efd4186fbc590fa664f9ed6f429.tar.bz2
Merge pull request #2606 from MikeMcQuaid/revert-vendor-gems
Revert gem vendoring experiment.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/Gemfile12
-rw-r--r--Library/Homebrew/test/Gemfile.lock65
-rw-r--r--Library/Homebrew/test/cask/cask_spec.rb6
-rw-r--r--Library/Homebrew/test/cask/cli/style_spec.rb4
-rw-r--r--Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb10
-rw-r--r--Library/Homebrew/test/support/lib/config.rb8
6 files changed, 92 insertions, 13 deletions
diff --git a/Library/Homebrew/test/Gemfile b/Library/Homebrew/test/Gemfile
new file mode 100644
index 000000000..f3c16c710
--- /dev/null
+++ b/Library/Homebrew/test/Gemfile
@@ -0,0 +1,12 @@
+source "https://rubygems.org"
+
+gem "parallel_tests"
+gem "rspec"
+gem "rubocop"
+gem "rspec-its", require: false
+gem "rspec-wait", require: false
+
+group :coverage do
+ gem "simplecov", require: false
+ gem "codecov", require: false
+end
diff --git a/Library/Homebrew/test/Gemfile.lock b/Library/Homebrew/test/Gemfile.lock
new file mode 100644
index 000000000..4d4eefd7d
--- /dev/null
+++ b/Library/Homebrew/test/Gemfile.lock
@@ -0,0 +1,65 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ ast (2.3.0)
+ codecov (0.1.9)
+ json
+ simplecov
+ url
+ diff-lcs (1.3)
+ docile (1.1.5)
+ json (2.0.3)
+ parallel (1.10.0)
+ parallel_tests (2.13.0)
+ parallel
+ parser (2.4.0.0)
+ ast (~> 2.2)
+ powerpack (0.1.1)
+ rainbow (2.2.1)
+ rspec (3.5.0)
+ rspec-core (~> 3.5.0)
+ rspec-expectations (~> 3.5.0)
+ rspec-mocks (~> 3.5.0)
+ rspec-core (3.5.4)
+ rspec-support (~> 3.5.0)
+ rspec-expectations (3.5.0)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.5.0)
+ rspec-its (1.2.0)
+ rspec-core (>= 3.0.0)
+ rspec-expectations (>= 3.0.0)
+ rspec-mocks (3.5.0)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.5.0)
+ rspec-support (3.5.0)
+ rspec-wait (0.0.9)
+ rspec (>= 3, < 4)
+ rubocop (0.47.1)
+ parser (>= 2.3.3.1, < 3.0)
+ powerpack (~> 0.1)
+ rainbow (>= 1.99.1, < 3.0)
+ ruby-progressbar (~> 1.7)
+ unicode-display_width (~> 1.0, >= 1.0.1)
+ ruby-progressbar (1.8.1)
+ simplecov (0.13.0)
+ docile (~> 1.1.0)
+ json (>= 1.8, < 3)
+ simplecov-html (~> 0.10.0)
+ simplecov-html (0.10.0)
+ unicode-display_width (1.1.3)
+ url (0.3.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ codecov
+ parallel_tests
+ rspec
+ rspec-its
+ rspec-wait
+ rubocop
+ simplecov
+
+BUNDLED WITH
+ 1.14.5
diff --git a/Library/Homebrew/test/cask/cask_spec.rb b/Library/Homebrew/test/cask/cask_spec.rb
index a8c4ecf5f..3736f3c01 100644
--- a/Library/Homebrew/test/cask/cask_spec.rb
+++ b/Library/Homebrew/test/cask/cask_spec.rb
@@ -24,7 +24,7 @@ describe Hbc::Cask, :cask do
describe "load" do
let(:tap_path) { Hbc.default_tap.path }
let(:file_dirname) { Pathname.new(__FILE__).dirname }
- let(:relative_tap_path) { tap_path.realpath.relative_path_from(file_dirname) }
+ let(:relative_tap_path) { tap_path.relative_path_from(file_dirname) }
it "returns an instance of the Cask for the given token" do
c = Hbc::CaskLoader.load("local-caffeine")
@@ -56,9 +56,7 @@ describe Hbc::Cask, :cask do
end
it "returns an instance of the Cask from a relative file location" do
- c = file_dirname.cd do
- Hbc::CaskLoader.load(relative_tap_path/"Casks/local-caffeine.rb")
- end
+ c = Hbc::CaskLoader.load(relative_tap_path/"Casks/local-caffeine.rb")
expect(c).to be_kind_of(Hbc::Cask)
expect(c.token).to eq("local-caffeine")
end
diff --git a/Library/Homebrew/test/cask/cli/style_spec.rb b/Library/Homebrew/test/cask/cli/style_spec.rb
index d021d8000..d41636beb 100644
--- a/Library/Homebrew/test/cask/cli/style_spec.rb
+++ b/Library/Homebrew/test/cask/cli/style_spec.rb
@@ -62,7 +62,7 @@ describe Hbc::CLI::Style, :cask do
context "when installation succeeds" do
before do
- allow(Homebrew).to receive(:run_bundler_if_needed!)
+ allow(Homebrew).to receive(:install_gem_setup_path!)
end
it "exits successfully" do
@@ -72,7 +72,7 @@ describe Hbc::CLI::Style, :cask do
context "when installation fails" do
before do
- allow(Homebrew).to receive(:run_bundler_if_needed!).and_raise(SystemExit)
+ allow(Homebrew).to receive(:install_gem_setup_path!).and_raise(SystemExit)
end
it "raises an error" do
diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
index 3a36f1853..ae1854f58 100644
--- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
+++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb
@@ -89,10 +89,12 @@ RSpec.shared_context "integration test" do
ruby_args << "-rtest/support/helper/integration_mocks"
ruby_args << (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path.to_s
- stdout, stderr, status = Open3.capture3(env, RUBY_PATH, *ruby_args, *args)
- $stdout.print stdout
- $stderr.print stderr
- status
+ Bundler.with_original_env do
+ stdout, stderr, status = Open3.capture3(env, RUBY_PATH, *ruby_args, *args)
+ $stdout.print stdout
+ $stderr.print stderr
+ status
+ end
end
def setup_test_formula(name, content = nil)
diff --git a/Library/Homebrew/test/support/lib/config.rb b/Library/Homebrew/test/support/lib/config.rb
index 41f4cbe33..3a0a76722 100644
--- a/Library/Homebrew/test/support/lib/config.rb
+++ b/Library/Homebrew/test/support/lib/config.rb
@@ -2,6 +2,8 @@ unless ENV["HOMEBREW_BREW_FILE"]
raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
end
+require "constants"
+
require "tmpdir"
require "pathname"
@@ -14,9 +16,9 @@ TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k|
end
# Paths pointing into the Homebrew code base that persist across test runs
-HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../../..", __FILE__))
-HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY_PATH.parent+"Homebrew/shims"
-HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH, ENV["HOMEBREW_GEMS_LOAD_PATH"]].join(":")
+HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../../..", __FILE__))
+HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY_PATH.parent+"Homebrew/shims"
+HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
# Paths redirected to a temporary directory and wiped at the end of the test run
HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")