2018-11-02 19:07:56 -04:00
# frozen_string_literal: true
2019-04-14 02:01:35 -04:00
RSpec . describe " major deprecations " do
let ( :warnings ) { err }
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
describe " Bundler " do
2018-11-02 19:07:56 -04:00
before do
2019-04-14 02:01:35 -04:00
install_gemfile! <<-G
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo1 ) } "
2019-04-14 02:01:35 -04:00
gem " rack "
G
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " .clean_env " do
before do
source = " Bundler.clean_env "
bundle " exec ruby -e #{ source . dump } "
end
it " is deprecated in favor of .unbundled_env " , :bundler = > " 2 " do
expect ( deprecations ) . to include \
" `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
2019-11-11 03:57:45 -05:00
" If you instead want the environment before bundler was originally loaded, use `Bundler.original_env` " \
" (called at -e:1) "
2019-04-14 02:01:35 -04:00
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
pending " is removed and shows a helpful error message about it " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " .with_clean_env " do
before do
source = " Bundler.with_clean_env {} "
bundle " exec ruby -e #{ source . dump } "
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
it " is deprecated in favor of .unbundled_env " , :bundler = > " 2 " do
expect ( deprecations ) . to include (
" `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
2019-11-11 03:57:45 -05:00
" If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env` " \
" (called at -e:1) "
2019-04-14 02:01:35 -04:00
)
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
pending " is removed and shows a helpful error message about it " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " .clean_system " do
before do
source = " Bundler.clean_system('ls') "
2018-11-02 19:07:56 -04:00
bundle " exec ruby -e #{ source . dump } "
end
2019-04-14 02:01:35 -04:00
it " is deprecated in favor of .unbundled_system " , :bundler = > " 2 " do
expect ( deprecations ) . to include (
" `Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \
2019-11-11 03:57:45 -05:00
" If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system` " \
" (called at -e:1) "
2019-04-14 02:01:35 -04:00
)
end
pending " is removed and shows a helpful error message about it " , :bundler = > " 3 "
end
describe " .clean_exec " do
before do
source = " Bundler.clean_exec('ls') "
bundle " exec ruby -e #{ source . dump } "
end
it " is deprecated in favor of .unbundled_exec " , :bundler = > " 2 " do
expect ( deprecations ) . to include (
" `Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \
2019-11-11 03:57:45 -05:00
" If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec` " \
" (called at -e:1) "
2019-04-14 02:01:35 -04:00
)
end
pending " is removed and shows a helpful error message about it " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
describe " .environment " do
2019-04-14 02:01:35 -04:00
before do
2018-11-02 19:07:56 -04:00
source = " Bundler.environment "
bundle " exec ruby -e #{ source . dump } "
end
2019-04-14 02:01:35 -04:00
it " is deprecated in favor of .load " , :bundler = > " 2 " do
2019-11-11 03:57:45 -05:00
expect ( deprecations ) . to include " Bundler.environment has been removed in favor of Bundler.load (called at -e:1) "
2019-04-14 02:01:35 -04:00
end
pending " is removed and shows a helpful error message about it " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
describe " bundle update --quiet " do
it " does not print any deprecations " do
2020-06-03 12:43:17 -04:00
bundle :update , :quiet = > true , :raise_on_error = > false
2019-04-14 02:01:35 -04:00
expect ( deprecations ) . to be_empty
end
end
2019-08-16 06:08:22 -04:00
context " bundle check --path " do
before do
install_gemfile <<-G
source " #{ file_uri_for ( gem_repo1 ) } "
gem " rack "
G
2020-06-03 12:43:17 -04:00
bundle " check --path vendor/bundle " , :raise_on_error = > false
2019-08-16 06:08:22 -04:00
end
2020-05-08 01:19:04 -04:00
it " should print a deprecation warning " , :bundler = > " 2 " do
expect ( deprecations ) . to include (
" The `--path` flag is deprecated because it relies on being " \
" remembered across bundler invocations, which bundler will no " \
" longer do in future versions. Instead please use `bundle config set " \
" path 'vendor/bundle'`, and stop using this flag "
)
end
pending " should fail with a helpful error " , :bundler = > " 3 "
end
context " bundle check --path= " do
before do
install_gemfile <<-G
source " #{ file_uri_for ( gem_repo1 ) } "
gem " rack "
G
2020-06-03 12:43:17 -04:00
bundle " check --path=vendor/bundle " , :raise_on_error = > false
2020-05-08 01:19:04 -04:00
end
2019-08-16 06:08:22 -04:00
it " should print a deprecation warning " , :bundler = > " 2 " do
expect ( deprecations ) . to include (
" The `--path` flag is deprecated because it relies on being " \
2019-11-11 03:57:45 -05:00
" remembered across bundler invocations, which bundler will no " \
2019-08-16 06:08:22 -04:00
" longer do in future versions. Instead please use `bundle config set " \
" path 'vendor/bundle'`, and stop using this flag "
)
end
pending " should fail with a helpful error " , :bundler = > " 3 "
end
2019-04-14 02:01:35 -04:00
describe " bundle config " do
describe " old list interface " do
before do
bundle! " config "
2018-11-02 19:07:56 -04:00
end
2019-12-14 05:49:16 -05:00
it " warns " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
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. " )
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
pending " fails with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " old get interface " do
before do
bundle! " config waka "
end
2019-12-14 05:49:16 -05:00
it " warns " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
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
pending " fails with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " old set interface " do
before do
bundle! " config waka wakapun "
end
2019-12-14 05:49:16 -05:00
it " warns " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
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
pending " fails with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " old set interface with --local " do
before do
bundle! " config --local waka wakapun "
end
2019-12-14 05:49:16 -05:00
it " warns " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
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
pending " fails with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " old set interface with --global " do
before do
bundle! " config --global waka wakapun "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
2019-12-14 05:49:16 -05:00
it " warns " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
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
pending " fails with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " old unset interface " do
2018-11-02 19:07:56 -04:00
before do
2019-04-14 02:01:35 -04:00
bundle! " config --delete waka "
2018-11-02 19:07:56 -04:00
end
2019-12-14 05:49:16 -05:00
it " warns " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
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. " )
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
pending " fails with a helpful error " , :bundler = > " 3 "
end
describe " old unset interface with --local " do
before do
bundle! " config --delete --local waka "
end
2019-12-14 05:49:16 -05:00
it " warns " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
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. " )
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
pending " fails with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
describe " old unset interface with --global " do
before do
bundle! " config --delete --global waka "
end
2018-11-02 19:07:56 -04:00
2019-12-14 05:49:16 -05:00
it " warns " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
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. " )
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
pending " fails with a helpful error " , :bundler = > " 3 "
end
end
describe " bundle update " do
before do
install_gemfile <<-G
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo1 ) } "
2019-04-14 02:01:35 -04:00
gem " rack "
G
end
2019-12-14 05:49:16 -05:00
it " warns when no options are given " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
bundle! " update "
expect ( deprecations ) . to include ( " Pass --all to `bundle update` to update everything " )
end
pending " fails with a helpful error when no options are given " , :bundler = > " 3 "
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
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo1 ) } "
2019-04-14 02:01:35 -04:00
gem " rack "
G
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` " )
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
pending " fails with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
context " bundle install with both gems.rb and Gemfile present " do
2018-11-02 19:07:56 -04:00
it " should not warn about gems.rb " do
create_file " gems.rb " , <<-G
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo1 ) } "
2018-11-02 19:07:56 -04:00
gem " rack "
G
bundle :install
2019-04-14 02:01:35 -04:00
expect ( deprecations ) . to be_empty
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:05:27 -04:00
it " should print a proper warning, and use gems.rb " do
2018-11-02 19:07:56 -04:00
create_file " gems.rb "
install_gemfile! <<-G
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo1 ) } "
2018-11-02 19:07:56 -04:00
gem " rack "
G
2019-04-14 02:01:35 -04:00
expect ( warnings ) . to include (
" Multiple gemfiles (gems.rb and Gemfile) detected. Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.rb.locked. "
)
expect ( the_bundle ) . not_to include_gem " rack 1.0 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
context " bundle install with flags " do
before do
bundle " config set --local path vendor/bundle "
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
install_gemfile <<-G
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo1 ) } "
2019-04-14 02:01:35 -04:00
gem " rack "
G
end
{
2020-05-21 08:05:07 -04:00
" clean " = > [ " clean " , true ] ,
" deployment " = > [ " deployment " , true ] ,
" frozen " = > [ " frozen " , true ] ,
" no-cache " = > [ " no_cache " , true ] ,
2020-05-25 06:19:13 -04:00
" no-deployment " = > [ " deployment " , false ] ,
2020-05-21 08:05:07 -04:00
" no-prune " = > [ " no_prune " , true ] ,
" path " = > [ " path " , " vendor/bundle " ] ,
" shebang " = > [ " shebang " , " ruby27 " ] ,
" system " = > [ " system " , true ] ,
" without " = > [ " without " , " development " ] ,
" with " = > [ " with " , " development " ] ,
} . each do | name , expectations |
option_name , value = * expectations
2019-04-14 02:01:35 -04:00
flag_name = " -- #{ name } "
context " with the #{ flag_name } flag " do
before do
bundle " install " # to create a lockfile, which deployment or frozen need
bundle " install #{ flag_name } #{ value } "
end
it " should print a deprecation warning " , :bundler = > " 2 " do
expect ( deprecations ) . to include (
" The ` #{ flag_name } ` flag is deprecated because it relies on " \
2019-11-11 03:57:45 -05:00
" being remembered across bundler invocations, which bundler " \
2019-04-14 02:01:35 -04:00
" will no longer do in future versions. Instead please use " \
2020-05-21 08:05:07 -04:00
" `bundle config set #{ option_name } ' #{ value } '`, and stop using this flag "
2019-04-14 02:01:35 -04:00
)
end
pending " should fail with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
end
end
2019-04-14 02:01:35 -04:00
context " bundle install with multiple sources " do
before do
install_gemfile <<-G
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo3 ) } "
source " #{ file_uri_for ( gem_repo1 ) } "
2019-04-14 02:01:35 -04:00
G
end
it " shows a deprecation " , :bundler = > " 2 " do
expect ( deprecations ) . to include (
" Your Gemfile contains multiple primary sources. " \
" Using `source` more than once without a block is a security risk, and " \
" may result in installing unexpected gems. To resolve this warning, use " \
" a block to indicate which gems should come from the secondary source. " \
" To upgrade this warning to an error, run `bundle config set " \
" disable_multisource true`. "
)
end
pending " should fail with a helpful error " , :bundler = > " 3 "
end
2018-11-02 19:07:56 -04:00
context " when Bundler.setup is run in a ruby script " do
2019-04-14 02:01:35 -04:00
before do
2018-11-02 19:07:56 -04:00
create_file " gems.rb "
install_gemfile! <<-G
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo1 ) } "
2018-11-02 19:07:56 -04:00
gem " rack " , :group = > :test
G
ruby <<-RUBY
2019-11-12 17:57:02 -05:00
require '#{lib_dir}/bundler'
2018-11-02 19:07:56 -04:00
Bundler . setup
Bundler . setup
RUBY
2019-04-14 02:01:35 -04:00
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:05:27 -04:00
it " should print a single deprecation warning " do
2019-04-14 02:01:35 -04:00
expect ( warnings ) . to include (
" Multiple gemfiles (gems.rb and Gemfile) detected. Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.rb.locked. "
)
2018-11-02 19:07:56 -04:00
end
end
context " when `bundler/deployment` is required in a ruby script " do
2019-04-14 02:01:35 -04:00
before do
2020-05-15 08:31:12 -04:00
ruby ( <<-RUBY, :env => env_for_missing_prerelease_default_gem_activation)
2018-11-02 19:07:56 -04:00
require 'bundler/deployment'
RUBY
2019-04-14 02:01:35 -04:00
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
it " should print a capistrano deprecation warning " , :bundler = > " 2 " do
expect ( deprecations ) . to include ( " Bundler no longer integrates " \
2018-11-02 19:07:56 -04:00
" with Capistrano, but Capistrano provides " \
" its own integration with Bundler via the " \
" capistrano-bundler gem. Use it instead. " )
end
2019-04-14 02:01:35 -04:00
pending " should fail with a helpful error " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
describe Bundler :: Dsl do
before do
@rubygems = double ( " rubygems " )
allow ( Bundler :: Source :: Rubygems ) . to receive ( :new ) { @rubygems }
end
context " with github gems " do
2020-05-15 08:31:12 -04:00
it " does not warn about removal " , :bundler = > " 2 " do
expect ( Bundler . ui ) . not_to receive ( :warn )
subject . gem ( " sparks " , :github = > " indirect/sparks " )
github_uri = " https://github.com/indirect/sparks.git "
expect ( subject . dependencies . first . source . uri ) . to eq ( github_uri )
end
it " warns about removal " , :bundler = > " 3 " do
2019-06-01 05:49:40 -04:00
msg = <<-EOS
The :github git source is deprecated , and will be removed in the future . Change any " reponame " :github sources to " username/reponame " . Add this code to the top of your Gemfile to ensure it continues to work :
2018-11-02 19:07:56 -04:00
2019-06-01 05:49:40 -04:00
git_source ( :github ) { | repo_name | " https://github.com/ \# {repo_name}.git " }
EOS
2020-05-15 08:31:12 -04:00
expect ( Bundler . ui ) . to receive ( :warn ) . with ( " [DEPRECATED] #{ msg } " )
2018-11-02 19:07:56 -04:00
subject . gem ( " sparks " , :github = > " indirect/sparks " )
github_uri = " https://github.com/indirect/sparks.git "
expect ( subject . dependencies . first . source . uri ) . to eq ( github_uri )
end
end
context " with bitbucket gems " do
2020-05-15 08:31:12 -04:00
it " does not warn about removal " , :bundler = > " 2 " do
expect ( Bundler . ui ) . not_to receive ( :warn )
subject . gem ( " not-really-a-gem " , :bitbucket = > " mcorp/flatlab-rails " )
end
it " warns about removal " , :bundler = > " 3 " do
2018-11-02 19:07:56 -04:00
msg = <<-EOS
2019-04-14 02:01:35 -04:00
The :bitbucket git source is deprecated , and will be removed in the future . Add this code to the top of your Gemfile to ensure it continues to work :
2018-11-02 19:07:56 -04:00
git_source ( :bitbucket ) do | repo_name |
user_name , repo_name = repo_name . split ( " / " )
repo_name || = user_name
" https:// \# {user_name}@bitbucket.org/ \# {user_name}/ \# {repo_name}.git "
end
EOS
2020-05-15 08:31:12 -04:00
expect ( Bundler . ui ) . to receive ( :warn ) . with ( " [DEPRECATED] #{ msg } " )
2018-11-02 19:07:56 -04:00
subject . gem ( " not-really-a-gem " , :bitbucket = > " mcorp/flatlab-rails " )
end
end
context " with gist gems " do
2020-05-15 08:31:12 -04:00
it " does not warn about removal " , :bundler = > " 2 " do
expect ( Bundler . ui ) . not_to receive ( :warn )
subject . gem ( " not-really-a-gem " , :gist = > " 1234 " )
end
it " warns about removal " , :bundler = > " 3 " do
2019-04-14 02:01:35 -04:00
msg = <<-EOS
The :gist git source is deprecated , and will be removed in the future . Add this code to the top of your Gemfile to ensure it continues to work :
git_source ( :gist ) { | repo_name | " https://gist.github.com/ \# {repo_name}.git " }
EOS
2020-05-15 08:31:12 -04:00
expect ( Bundler . ui ) . to receive ( :warn ) . with ( " [DEPRECATED] #{ msg } " )
2018-11-02 19:07:56 -04:00
subject . gem ( " not-really-a-gem " , :gist = > " 1234 " )
end
end
end
context " bundle show " do
2019-04-14 02:01:35 -04:00
before do
2018-11-02 19:07:56 -04:00
install_gemfile! <<-G
2019-05-06 12:06:21 -04:00
source " #{ file_uri_for ( gem_repo1 ) } "
2018-11-02 19:07:56 -04:00
gem " rack "
G
2019-04-14 02:01:35 -04:00
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
context " without flags " do
before do
bundle! :show
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
it " prints a deprecation warning recommending `bundle list` " , :bundler = > " 2 " do
expect ( deprecations ) . to include ( " use `bundle list` instead of `bundle show` " )
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
pending " fails with a helpful message " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
context " with --outdated flag " do
before do
bundle! " show --outdated "
end
it " prints a deprecation warning informing about its removal " , :bundler = > " 2 " do
expect ( deprecations ) . to include ( " the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement " )
end
pending " fails with a helpful message " , :bundler = > " 3 "
end
context " with --verbose flag " do
before do
bundle! " show --verbose "
end
it " prints a deprecation warning informing about its removal " , :bundler = > " 2 " do
expect ( deprecations ) . to include ( " the `--verbose` flag to `bundle show` was undocumented and will be removed without replacement " )
end
pending " fails with a helpful message " , :bundler = > " 3 "
end
context " with a gem argument " do
before do
bundle! " show rack "
end
it " prints a deprecation warning recommending `bundle info` " , :bundler = > " 2 " do
expect ( deprecations ) . to include ( " use `bundle info rack` instead of `bundle show rack` " )
end
2019-06-01 05:49:40 -04:00
pending " fails with a helpful message " , :bundler = > " 3 "
end
context " with the --paths option " do
before do
bundle " show --paths "
end
it " prints a deprecation warning recommending `bundle list` " , :bundler = > " 2 " do
expect ( deprecations ) . to include ( " use `bundle list` instead of `bundle show --paths` " )
end
pending " fails with a helpful message " , :bundler = > " 3 "
2019-04-14 02:01:35 -04:00
end
2019-06-01 05:49:40 -04:00
context " with a gem argument and the --paths option " do
before do
bundle " show rack --paths "
end
it " prints deprecation warning recommending `bundle info` " , :bundler = > " 2 " do
expect ( deprecations ) . to include ( " use `bundle info rack --path` instead of `bundle show rack --paths` " )
end
pending " fails with a helpful message " , :bundler = > " 3 "
end
2018-11-02 19:07:56 -04:00
end
context " bundle console " do
2019-04-14 02:01:35 -04:00
before do
2020-06-03 12:43:17 -04:00
bundle " console " , :raise_on_error = > false
2019-04-14 02:01:35 -04:00
end
2018-11-02 19:07:56 -04:00
2019-04-14 02:01:35 -04:00
it " prints a deprecation warning " , :bundler = > " 2 " do
expect ( deprecations ) . to include \
" bundle console will be replaced by `bin/console` generated by `bundle gem <name>` "
2018-11-02 19:07:56 -04:00
end
2019-04-14 02:01:35 -04:00
pending " fails with a helpful message " , :bundler = > " 3 "
end
context " bundle viz " do
before do
2020-05-15 08:31:12 -04:00
graphviz_version = RUBY_VERSION > = " 2.4 " ? " 1.2.5 " : " 1.2.4 "
realworld_system_gems " ruby-graphviz --version #{ graphviz_version } "
2019-04-14 02:01:35 -04:00
create_file " gems.rb "
bundle " viz "
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
pending " fails with a helpful message " , :bundler = > " 3 "
2018-11-02 19:07:56 -04:00
end
end