aboutsummaryrefslogtreecommitdiffstats
path: root/spec/update
diff options
context:
space:
mode:
authorjoyicecloud <joyicecloud@gmail.com>2013-09-03 15:37:56 -0700
committerjoyicecloud <joyicecloud@gmail.com>2013-09-18 14:24:17 -0700
commit43732e9c1b3a7510d0592d2a2f357855abab18d7 (patch)
tree7e8de92c9e2c2b10dfdd4b11e420727f0a3890fc /spec/update
parent7bd82641de44de6601a03ae455ce9277bcdf04b0 (diff)
downloadbundler-43732e9c1b3a7510d0592d2a2f357855abab18d7.tar.gz
Displays the previous version of the gem when run bundle update
Change code in the 3 source files to display the method locked_gems in lib/bundler.rb Add 3 Rspec test in the update directory for each source: rubygems, git, path.
Diffstat (limited to 'spec/update')
-rw-r--r--spec/update/gems_spec.rb21
-rw-r--r--spec/update/git_spec.rb23
-rw-r--r--spec/update/source_spec.rb15
3 files changed, 58 insertions, 1 deletions
diff --git a/spec/update/gems_spec.rb b/spec/update/gems_spec.rb
index 26a367d0..aa972147 100644
--- a/spec/update/gems_spec.rb
+++ b/spec/update/gems_spec.rb
@@ -151,3 +151,24 @@ describe "bundle update when a gem depends on a newer version of bundler" do
expect(out).to match(/perhaps you need to update bundler/i)
end
end
+
+describe "bundle update" do
+ it "shows the previous version of the gem when updated from rubygems source" do
+ build_repo2
+
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "activesupport"
+ G
+
+ bundle "update"
+ expect(out).to include("Using activesupport (2.3.5)")
+
+ update_repo2 do
+ build_gem "activesupport", "3.0"
+ end
+
+ bundle "update"
+ expect(out).to include("Installing activesupport (3.0) was (2.3.5)")
+ end
+end \ No newline at end of file
diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb
index cba5a1f7..9fb9c391 100644
--- a/spec/update/git_spec.rb
+++ b/spec/update/git_spec.rb
@@ -209,5 +209,28 @@ describe "bundle update" do
expect(out).to include("Your bundle is updated!")
end
+ it "shows the previous version of the gem" do
+ build_git "rails", "3.0", :path => lib_path("rails")
+
+ install_gemfile <<-G
+ gem "rails", :git => "#{lib_path('rails')}"
+ G
+
+ lockfile <<-G
+ GIT
+ remote: #{lib_path("rails")}
+ specs:
+ rails (2.3.2)
+
+ PLATFORMS
+ #{generic(Gem::Platform.local)}
+
+ DEPENDENCIES
+ rails!
+ G
+
+ bundle "update"
+ expect(out).to include("Using rails (3.0) was (2.3.2) from #{lib_path('rails')} (at master)")
+ end
end
end
diff --git a/spec/update/source_spec.rb b/spec/update/source_spec.rb
index 22f32254..9768e155 100644
--- a/spec/update/source_spec.rb
+++ b/spec/update/source_spec.rb
@@ -1,6 +1,6 @@
require "spec_helper"
-describe "bundle update" do
+describe "bundle update --source" do
describe "git sources" do
before :each do
build_repo2
@@ -46,5 +46,18 @@ describe "bundle update" do
bundle "update --source foo"
should_be_installed "rack 1.0"
end
+
+ it "shows the previous version of the gem when updated from path source" do
+ build_lib "activesupport", "2.3.5", :path => lib_path("rails/activesupport")
+
+ install_gemfile <<-G
+ gem "activesupport", :path => "#{lib_path('rails/activesupport')}"
+ G
+
+ build_lib "activesupport", "3.0", :path => lib_path("rails/activesupport")
+
+ bundle "update --source activesupport"
+ expect(out).to include("Using activesupport (3.0) was (2.3.5) from source at #{lib_path('rails/activesupport')}")
+ end
end
end