summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-14 12:29:10 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-15 12:31:32 +0100
commit5da7195b52e2508c04d5c53bd91cce08cce5ddb0 (patch)
treeb7c94e7f8d072cda51682b4471aefe69e567f80f
parent449e7fa5c8d0fab7c026ce8b3cc9ca3eb01e7253 (diff)
downloadbundler-5da7195b52e2508c04d5c53bd91cce08cce5ddb0.tar.gz
Test and fix `bundle viz` command deprecation
-rw-r--r--lib/bundler/feature_flag.rb2
-rw-r--r--spec/commands/viz_spec.rb2
-rw-r--r--spec/other/major_deprecation_spec.rb21
3 files changed, 23 insertions, 2 deletions
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index e01676f97d..5e5d97ec42 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -56,7 +56,7 @@ module Bundler
settings_flag(:unlock_source_unlocks_spec) { !bundler_2_mode? }
settings_flag(:update_requires_all_flag) { bundler_3_mode? }
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_2_mode? }
- settings_flag(:viz_command) { !bundler_2_mode? }
+ settings_flag(:viz_command) { !bundler_3_mode? }
settings_option(:default_cli_command) { bundler_2_mode? ? :cli_help : :install }
diff --git a/spec/commands/viz_spec.rb b/spec/commands/viz_spec.rb
index c4e77b9179..96cc21b5f7 100644
--- a/spec/commands/viz_spec.rb
+++ b/spec/commands/viz_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.describe "bundle viz", :bundler => "< 2", :if => Bundler.which("dot") do
+RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot") do
let(:ruby_graphviz) do
graphviz_glob = base_system_gems.join("cache/ruby-graphviz*")
Pathname.glob(graphviz_glob).first
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index ab294ad444..3eeeb32b89 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -328,4 +328,25 @@ The :gist git source is deprecated, and will be removed in the future. Add this
"bundle console will be replaced by `bin/console` generated by `bundle gem <name>`"
end
end
+
+ context "bundle viz" do
+ let(:ruby_graphviz) do
+ graphviz_glob = base_system_gems.join("cache/ruby-graphviz*")
+ Pathname.glob(graphviz_glob).first
+ end
+
+ before do
+ system_gems ruby_graphviz
+ create_file "gems.rb"
+ bundle "viz"
+ end
+
+ it "does not print a deprecation warning", :bundler => "< 2" do
+ expect(deprecations).to be_empty
+ end
+
+ it "prints a deprecation warning", :bundler => "2" do
+ expect(deprecations).to include "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
+ end
+ end
end