summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-21 12:38:13 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-05 13:19:05 +0200
commit3494269b35a9d9d6580eb978663d6156c297bf4d (patch)
treeed3baff6c8cff9db562a05227f570fd27a4b7a1e /spec
parent1db65c45d2552b452087209a59471ae9d8611aa6 (diff)
downloadbundler-3494269b35a9d9d6580eb978663d6156c297bf4d.tar.gz
Fix major deprecation specs nesting
They not all need to create & install a Gemfile, so let's do only what's needed. Also the spec descriptions are simpler when no so deeply nested.
Diffstat (limited to 'spec')
-rw-r--r--spec/other/major_deprecation_spec.rb224
1 files changed, 115 insertions, 109 deletions
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index e67c524206..503ba5784a 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -96,164 +96,170 @@ RSpec.describe "major deprecations" do
expect(deprecations).to include "Bundler.environment has been removed in favor of Bundler.load"
end
end
+ end
- describe "bundle update --quiet" do
- it "does not print any deprecations" do
- bundle :update, :quiet => true
- expect(deprecations).to be_empty
- end
+ describe "bundle update --quiet" do
+ it "does not print any deprecations" do
+ bundle :update, :quiet => true
+ expect(deprecations).to be_empty
end
+ end
- describe "bundle config" do
- describe "old list interface" do
- before do
- bundle! "config"
- end
-
- it "does not warn", :bundler => "< 2" do
- expect(deprecations).to be_empty
- end
-
- it "warns", :bundler => "2" do
- expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config list` instead.")
- end
+ describe "bundle config" do
+ describe "old list interface" do
+ before do
+ bundle! "config"
end
- describe "old get interface" do
- before do
- bundle! "config waka"
- end
-
- it "does not warn", :bundler => "< 2" do
- expect(deprecations).to be_empty
- end
-
- it "warns", :bundler => "2" do
- expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config get waka` instead.")
- end
+ it "does not warn", :bundler => "< 2" do
+ expect(deprecations).to be_empty
end
- describe "old set interface" do
- before do
- bundle! "config waka wakapun"
- end
-
- it "does not warn", :bundler => "< 2" do
- expect(deprecations).to be_empty
- end
-
- it "warns", :bundler => "2" do
- expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config set waka wakapun` instead.")
- end
+ it "warns", :bundler => "2" do
+ expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config list` instead.")
end
+ end
- describe "old set interface with --local" do
- before do
- bundle! "config --local waka wakapun"
- end
-
- it "does not warn", :bundler => "< 2" do
- expect(deprecations).to be_empty
- end
-
- it "warns", :bundler => "2" do
- expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config set --local waka wakapun` instead.")
- end
+ describe "old get interface" do
+ before do
+ bundle! "config waka"
end
- describe "old set interface with --global" do
- before do
- bundle! "config --global waka wakapun"
- end
-
- it "does not warn", :bundler => "< 2" do
- expect(deprecations).to be_empty
- end
+ it "does not warn", :bundler => "< 2" do
+ expect(deprecations).to be_empty
+ end
- it "warns", :bundler => "2" do
- expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config set --global waka wakapun` instead.")
- end
+ it "warns", :bundler => "2" do
+ expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config get waka` instead.")
end
+ end
- describe "old unset interface" do
- before do
- bundle! "config --delete waka"
- end
+ describe "old set interface" do
+ before do
+ bundle! "config waka wakapun"
+ end
- it "does not warn", :bundler => "< 2" do
- expect(deprecations).to be_empty
- end
+ it "does not warn", :bundler => "< 2" do
+ expect(deprecations).to be_empty
+ end
- it "warns", :bundler => "2" do
- expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config unset waka` instead.")
- end
+ it "warns", :bundler => "2" do
+ expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config set waka wakapun` instead.")
end
+ end
- describe "old unset interface with --local" do
- before do
- bundle! "config --delete --local waka"
- end
+ describe "old set interface with --local" do
+ before do
+ bundle! "config --local waka wakapun"
+ end
- it "does not warn", :bundler => "< 2" do
- expect(deprecations).to be_empty
- end
+ it "does not warn", :bundler => "< 2" do
+ expect(deprecations).to be_empty
+ end
- it "warns", :bundler => "2" do
- expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config unset --local waka` instead.")
- end
+ it "warns", :bundler => "2" do
+ expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config set --local waka wakapun` instead.")
end
+ end
- describe "old unset interface with --global" do
- before do
- bundle! "config --delete --global waka"
- end
+ describe "old set interface with --global" do
+ before do
+ bundle! "config --global waka wakapun"
+ end
- it "does not warn", :bundler => "< 2" do
- expect(deprecations).to be_empty
- end
+ it "does not warn", :bundler => "< 2" do
+ expect(deprecations).to be_empty
+ end
- it "warns", :bundler => "2" do
- expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config unset --global waka` instead.")
- end
+ it "warns", :bundler => "2" do
+ expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config set --global waka wakapun` instead.")
end
end
- describe "bundle update" do
+ describe "old unset interface" do
before do
- bundle! "install"
+ bundle! "config --delete waka"
end
- it "does not warn when no options are given", :bundler => "< 2" do
- bundle! "update"
+ it "does not warn", :bundler => "< 2" do
expect(deprecations).to be_empty
end
- it "warns when no options are given", :bundler => "2" do
- bundle! "update"
- expect(deprecations).to include("Pass --all to `bundle update` to update everything")
+ it "warns", :bundler => "2" do
+ expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config unset waka` instead.")
+ end
+ end
+
+ describe "old unset interface with --local" do
+ before do
+ bundle! "config --delete --local waka"
end
- it "does not warn when --all is passed" do
- bundle! "update --all"
+ it "does not warn", :bundler => "< 2" do
expect(deprecations).to be_empty
end
+
+ it "warns", :bundler => "2" do
+ expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config unset --local waka` instead.")
+ end
end
- describe "bundle install --binstubs" do
+ describe "old unset interface with --global" do
before do
- bundle :install, :binstubs => true
+ bundle! "config --delete --global waka"
end
- it "should print no deprecations", :bundler => "< 2" do
+ it "does not warn", :bundler => "< 2" do
expect(deprecations).to be_empty
end
- it "should output a deprecation warning", :bundler => "2" do
- expect(deprecations).to include("The --binstubs option will be removed in favor of `bundle binstubs`")
+ it "warns", :bundler => "2" do
+ expect(deprecations).to include("Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle config unset --global waka` instead.")
end
end
end
+ describe "bundle update" do
+ before do
+ install_gemfile <<-G
+ source "file:#{gem_repo1}"
+ gem "rack"
+ G
+ end
+
+ it "does not warn when no options are given", :bundler => "< 2" do
+ bundle! "update"
+ expect(deprecations).to be_empty
+ end
+
+ it "warns when no options are given", :bundler => "2" do
+ bundle! "update"
+ expect(deprecations).to include("Pass --all to `bundle update` to update everything")
+ end
+
+ it "does not warn when --all is passed" do
+ bundle! "update --all"
+ expect(deprecations).to be_empty
+ end
+ end
+
+ describe "bundle install --binstubs" do
+ before do
+ install_gemfile <<-G, :binstubs => true
+ source "file:#{gem_repo1}"
+ gem "rack"
+ G
+ end
+
+ it "should print no deprecations", :bundler => "< 2" do
+ expect(deprecations).to be_empty
+ end
+
+ it "should output a deprecation warning", :bundler => "2" do
+ expect(deprecations).to include("The --binstubs option will be removed in favor of `bundle binstubs`")
+ end
+ end
+
context "when bundle install is run" do
it "should not warn about gems.rb" do
create_file "gems.rb", <<-G