summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-27 00:20:20 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-28 16:41:20 +0100
commitec56cdbd64c9ba920946e0fc3e823257189c8196 (patch)
treeb7b47eb46cee228b0ac5cd841d946f04e494edf3
parent93c7f551c09f7cc8badbcc4da2488d1664909f95 (diff)
downloadbundler-ec56cdbd64c9ba920946e0fc3e823257189c8196.tar.gz
Move some test setups to before blocks
-rw-r--r--spec/install/gemfile/sources_spec.rb7
-rw-r--r--spec/other/major_deprecation_spec.rb8
2 files changed, 10 insertions, 5 deletions
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index c8f46e48c8..b29346c800 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -54,11 +54,11 @@ RSpec.describe "bundle install with gems on multiple sources" do
gem "rack-obama"
gem "rack", "1.0.0" # force it to install the working version in repo1
G
- end
- it "warns about ambiguous gems, but installs anyway", :bundler => "< 2" do
bundle :install
+ end
+ it "warns about ambiguous gems, but installs anyway", :bundler => "< 2" do
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
expect(out).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo1}"))
@@ -244,10 +244,11 @@ RSpec.describe "bundle install with gems on multiple sources" do
gem "depends_on_rack"
end
G
+
+ bundle :install
end
it "installs from the other source and warns about ambiguous gems", :bundler => "< 2" do
- bundle :install
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
expect(out).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo2}"))
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index 6e20d254ab..da8d1f56f4 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -205,22 +205,26 @@ The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add
end
context "bundle show" do
- it "prints a deprecation warning" do
+ before do
install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
bundle! :show
+ end
+ it "prints a deprecation warning" do
expect(warnings).to have_major_deprecation a_string_including("use `bundle list` instead of `bundle show`")
end
end
context "bundle console" do
- it "prints a deprecation warning" do
+ before do
bundle "console"
+ end
+ it "prints a deprecation warning" do
expect(warnings).to have_major_deprecation \
a_string_including("bundle console will be replaced by `bin/console` generated by `bundle gem <name>`")
end