diff options
-rw-r--r-- | lib/bundler/cli/console.rb | 4 | ||||
-rw-r--r-- | spec/commands/console_spec.rb | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/cli/console.rb b/lib/bundler/cli/console.rb index 7c7010e7cf..c0ced54be2 100644 --- a/lib/bundler/cli/console.rb +++ b/lib/bundler/cli/console.rb @@ -7,6 +7,10 @@ module Bundler end def run + Bundler.ui.deprecate "bundle console is deprecated and will be replaced " \ + "by `bin/console` generated by `bundle gem <name>` " \ + "in Bundler 2.0.", true + group ? Bundler.require(:default, *(group.split.map!(&:to_sym))) : Bundler.require ARGV.clear diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb index f26fbcdba5..395dd259d2 100644 --- a/spec/commands/console_spec.rb +++ b/spec/commands/console_spec.rb @@ -10,6 +10,14 @@ describe "bundle console" do G end + it "prints a deprecation warning" do + bundle "console" + + expect(err).to include('bundle console is deprecated and will be replaced ' \ + 'by `bin/console` generated by `bundle gem <name>` ' \ + 'in Bundler 2.0.') + end + it "starts IRB with the default group loaded" do bundle "console" do |input| input.puts("puts RACK") |