summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBoggs <hello@boggs.xyz>2016-06-26 22:34:22 +0800
committerBoggs <hello@boggs.xyz>2016-06-28 09:20:35 +0800
commit04cb8658579aa2c7aeb383c21909380d07189ded (patch)
tree46cd57a8ff0dd51a6199c2dd23b3b1da17f005a4 /spec
parent961f0414fd4b955c151d8334f41ce9a2239176d8 (diff)
downloadbundler-04cb8658579aa2c7aeb383c21909380d07189ded.tar.gz
Limit warning to `bundle i` and `bundle install`
Reorganize specs Remove whitespace
Diffstat (limited to 'spec')
-rw-r--r--spec/commands/install_spec.rb27
-rw-r--r--spec/other/trampoline_spec.rb31
2 files changed, 31 insertions, 27 deletions
diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb
index cf98d42153..89bc5eee13 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/commands/install_spec.rb
@@ -3,18 +3,6 @@ require "spec_helper"
describe "bundle install with gem sources" do
describe "the simple case" do
- it "warns user (once) if Bundler is outdated" do
- gemfile <<-G
- source "file://#{gem_repo1}"
- G
-
- bundle :install, :env => { "BUNDLE_POSTIT_TRAMPOLINING_VERSION" => "999" }
- expect(out).to include("You're running Bundler 999 but this project uses #{Bundler::VERSION}.")
-
- bundle :install, :env => { "BUNDLE_POSTIT_TRAMPOLINING_VERSION" => "999" }
- expect(out).not_to include("You're running Bundler 999 but this project uses #{Bundler::VERSION}.")
- end
-
it "prints output and returns if no dependencies are specified" do
gemfile <<-G
source "file://#{gem_repo1}"
@@ -497,4 +485,19 @@ describe "bundle install with gem sources" do
"setting them for authentication.")
end
end
+
+ describe "warns user if Bundler is outdated" do
+ it "warns only once and is > 1.13.0.pre.1" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ G
+ ENV["BUNDLER_VERSION"] = "1.13.0.pre.1"
+
+ bundle :install, :env => { "BUNDLE_POSTIT_TRAMPOLINING_VERSION" => "999" }
+ expect(out).to include("You're running Bundler 999 but this project uses #{ENV["BUNDLER_VERSION"]}.")
+
+ bundle :install, :env => { "BUNDLE_POSTIT_TRAMPOLINING_VERSION" => "999" }
+ expect(out).not_to include("You're running Bundler 999 but this project uses #{ENV["BUNDLER_VERSION"]}.")
+ end
+ end
end
diff --git a/spec/other/trampoline_spec.rb b/spec/other/trampoline_spec.rb
index 54be4314dd..8f73050eae 100644
--- a/spec/other/trampoline_spec.rb
+++ b/spec/other/trampoline_spec.rb
@@ -7,21 +7,6 @@ describe "bundler version trampolining" do
FileUtils.rm_rf(system_gem_path)
FileUtils.cp_r(base_system_gems, system_gem_path)
end
- context "warnings" do
- it "warns user if Bundler is outdated and is < 1.13.0.pre.1" do
- ENV["BUNDLER_VERSION"] = "1.12.0"
- bundle! "--version"
- expect(out).to include(<<-WARN.strip)
-You're running Bundler #{Bundler::VERSION} but this project uses #{ENV["BUNDLER_VERSION"]}. To update, run `bundle update --bundler`.\n
- WARN
-
- ENV["BUNDLER_VERSION"] = "1.13.0.pre.1"
- bundle! "--version"
- expect(out).not_to include(<<-WARN.strip)
-You're running Bundler #{Bundler::VERSION} but this project uses #{ENV["BUNDLER_VERSION"]}. To update, run `bundle update --bundler`.\n
- WARN
- end
- end
context "version guessing" do
shared_examples_for "guesses" do |version|
@@ -149,4 +134,20 @@ The error was:
expect(out).to eq("1.12.0")
end
end
+
+ context "warnings" do
+ before do
+ simulate_bundler_version("1.12.0") do
+ install_gemfile ""
+ end
+ end
+
+ it "warns user if Bundler is outdated and is < 1.13.0.pre.1" do
+ ENV["BUNDLER_VERSION"] = "1.12.0"
+ bundle! "install"
+ expect(out).to include(<<-WARN.strip)
+You're running Bundler #{Bundler::VERSION} but this project uses #{ENV["BUNDLER_VERSION"]}. To update, run `bundle update --bundler`.\n
+ WARN
+ end
+ end
end