summaryrefslogtreecommitdiff
path: root/spec/update
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2013-02-11 23:55:32 -0800
committerTim Moore <tmoore@incrementalism.net>2014-07-30 14:16:35 +1000
commitc80fa890cfd06f1066a60d65cf6892dfce806661 (patch)
treeebcecd4931247b6ed258a3aa45240c3b8f0d1cc0 /spec/update
parent1a6ebc78de59632dd628adf1a2be38cef47b5b86 (diff)
downloadbundler-c80fa890cfd06f1066a60d65cf6892dfce806661.tar.gz
rearrange specs
Diffstat (limited to 'spec/update')
-rw-r--r--spec/update/git_spec.rb47
-rw-r--r--spec/update/path_spec.rb18
-rw-r--r--spec/update/source_spec.rb63
3 files changed, 65 insertions, 63 deletions
diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb
index 4d3a570f71..2452636c10 100644
--- a/spec/update/git_spec.rb
+++ b/spec/update/git_spec.rb
@@ -233,4 +233,51 @@ describe "bundle update" do
expect(out).to include("Using rails 3.0 (was 2.3.2) from #{lib_path('rails')} (at master)")
end
end
+
+ describe "with --source flag" do
+ before :each do
+ build_repo2
+ @git = build_git "foo", :path => lib_path("foo") do |s|
+ s.executables = "foobar"
+ end
+
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ git "#{lib_path('foo')}" do
+ gem 'foo'
+ end
+ gem 'rack'
+ G
+ end
+
+ it "updates the source" do
+ update_git "foo", :path => @git.path
+
+ bundle "update --source foo"
+
+ in_app_root do
+ run <<-RUBY
+ require 'foo'
+ puts "WIN" if defined?(FOO_PREV_REF)
+ RUBY
+
+ expect(out).to eq("WIN")
+ end
+ end
+
+ it "unlocks gems that were originally pulled in by the source" do
+ update_git "foo", "2.0", :path => @git.path
+
+ bundle "update --source foo"
+ should_be_installed "foo 2.0"
+ end
+
+ it "leaves all other gems frozen" do
+ update_repo2
+ update_git "foo", :path => @git.path
+
+ bundle "update --source foo"
+ should_be_installed "rack 1.0"
+ end
+ end
end
diff --git a/spec/update/path_spec.rb b/spec/update/path_spec.rb
new file mode 100644
index 0000000000..fdc4615b8a
--- /dev/null
+++ b/spec/update/path_spec.rb
@@ -0,0 +1,18 @@
+require "spec_helper"
+
+describe "path sources" do
+ describe "bundle update --source" do
+ 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
diff --git a/spec/update/source_spec.rb b/spec/update/source_spec.rb
deleted file mode 100644
index c9fe7c68fc..0000000000
--- a/spec/update/source_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require "spec_helper"
-
-describe "bundle update --source" do
- describe "git sources" do
- before :each do
- build_repo2
- @git = build_git "foo", :path => lib_path("foo") do |s|
- s.executables = "foobar"
- end
-
- install_gemfile <<-G
- source "file://#{gem_repo2}"
- git "#{lib_path('foo')}" do
- gem 'foo'
- end
- gem 'rack'
- G
- end
-
- it "updates the source" do
- update_git "foo", :path => @git.path
-
- bundle "update --source foo"
-
- in_app_root do
- run <<-RUBY
- require 'foo'
- puts "WIN" if defined?(FOO_PREV_REF)
- RUBY
-
- expect(out).to eq("WIN")
- end
- end
-
- it "unlocks gems that were originally pulled in by the source" do
- update_git "foo", "2.0", :path => @git.path
-
- bundle "update --source foo"
- should_be_installed "foo 2.0"
- end
-
- it "leaves all other gems frozen" do
- update_repo2
- update_git "foo", :path => @git.path
-
- 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