summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-05-05 13:46:58 -0700
committerSamuel Giddins <segiddins@segiddins.me>2016-07-05 15:10:43 -0300
commit214875311d30217d6512a3013726b92ba8826599 (patch)
tree68336bcf9327488e65452e40c67308d1e61aab54
parentad787438f368ed1aa86b59ab44a83c73687246fb (diff)
downloadbundler-214875311d30217d6512a3013726b92ba8826599.tar.gz
move deprecation specs to deprecation_spec.rb
-rw-r--r--spec/deprecation_spec.rb59
1 files changed, 59 insertions, 0 deletions
diff --git a/spec/deprecation_spec.rb b/spec/deprecation_spec.rb
new file mode 100644
index 0000000000..21cb9d72a4
--- /dev/null
+++ b/spec/deprecation_spec.rb
@@ -0,0 +1,59 @@
+# frozen_string_literal: true
+require "spec_helper"
+
+describe "Bundler version 1.99" do
+ context "when bundle is run" do
+ it "should print a single deprecation warning" do
+ # install_gemfile calls `bundle :install, opts`
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ expect(err).to eq("DEPRECATION: Gemfile and Gemfile.lock are " \
+ "deprecated and will be replaced with gems.rb and gems.locked in " \
+ "Bundler 2.0.0.")
+ end
+ end
+
+ context "when Bundler.setup is run in a ruby script" do
+ it "should print a single deprecation warning" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", :group => :test
+ G
+
+ ruby <<-RUBY
+ require 'rubygems'
+ require 'bundler'
+ require 'bundler/vendored_thor'
+
+ Bundler.ui = Bundler::UI::Shell.new
+ Bundler.setup
+ Bundler.setup
+ RUBY
+
+ expect(err).to eq("DEPRECATION: Gemfile and Gemfile.lock are " \
+ "deprecated and will be replaced with gems.rb and gems.locked in " \
+ "Bundler 2.0.0.")
+ end
+ end
+
+ context "when `bundler/deployment` is required in a ruby script" do
+ it "should print a capistrano deprecation warning" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", :group => :test
+ G
+
+ ruby(<<-RUBY, :expect_err => true)
+ require 'bundler/deployment'
+ RUBY
+
+ expect(err).to eq("DEPRECATION: Bundler no longer integrates " \
+ "with Capistrano, but Capistrano provides " \
+ "its own integration with Bundler via the " \
+ "capistrano-bundler gem. Use it instead.")
+ end
+ end
+end