summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-07-07 14:36:53 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-07-07 14:36:53 -0700
commit5b2d02fb6a78bf8b07f7b6d3f9407a961e3a7489 (patch)
tree59ba50bac87ff630cb806ad551076d26aa97d684 /spec
parentd3647992badb85d908e00769865ebdf1a89a8ea6 (diff)
downloadbundler-5b2d02fb6a78bf8b07f7b6d3f9407a961e3a7489.tar.gz
Make bundle install [PATH] namespace its gems to specific rubies
Diffstat (limited to 'spec')
-rw-r--r--spec/install/gems/platform_spec.rb13
-rw-r--r--spec/install/gems/simple_case_spec.rb12
-rw-r--r--spec/support/path.rb5
3 files changed, 24 insertions, 6 deletions
diff --git a/spec/install/gems/platform_spec.rb b/spec/install/gems/platform_spec.rb
index a7262ea6a4..dbc80c91ea 100644
--- a/spec/install/gems/platform_spec.rb
+++ b/spec/install/gems/platform_spec.rb
@@ -72,6 +72,19 @@ describe "bundle install across platforms" do
should_be_installed "nokogiri 1.4.2"
should_not_be_installed "weakling"
end
+
+ it "fetches gems again after changing the version of Ruby" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack", "1.0.0"
+ G
+
+ bundle "install ./vendor"
+
+ engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
+ bundled_app("vendor/#{engine}/#{RUBY_VERSION}/gems/rack-1.0.0").should exist
+ end
end
# TODO: Don't make the tests hardcoded to a platform
diff --git a/spec/install/gems/simple_case_spec.rb b/spec/install/gems/simple_case_spec.rb
index 282dc609cd..77444f2dad 100644
--- a/spec/install/gems/simple_case_spec.rb
+++ b/spec/install/gems/simple_case_spec.rb
@@ -250,7 +250,7 @@ describe "bundle install with gem sources" do
bundle :install
- bundled_app('vendor/gems/rack-1.0.0').should be_directory
+ vendored_gems('gems/rack-1.0.0').should be_directory
should_be_installed "rack 1.0.0"
end
@@ -269,7 +269,7 @@ describe "bundle install with gem sources" do
it "sets BUNDLE_PATH as the first argument to bundle install" do
bundle "install ./vendor"
- bundled_app('vendor/gems/rack-1.0.0').should be_directory
+ vendored_gems('gems/rack-1.0.0').should be_directory
should_be_installed "rack 1.0.0"
end
@@ -278,7 +278,7 @@ describe "bundle install with gem sources" do
build_gem "rack", "1.1.0", :to_system => true
bundle "install ./vendor"
- bundled_app('vendor/gems/rack-1.0.0').should be_directory
+ vendored_gems('gems/rack-1.0.0').should be_directory
should_be_installed "rack 1.0.0"
end
end
@@ -341,11 +341,11 @@ describe "bundle install with gem sources" do
gem "rack"
G
- bundle "install vendor/gems --disable-shared-gems"
- FileUtils.rm_rf bundled_app('vendor/gems')
+ bundle "install vendor --disable-shared-gems"
+ FileUtils.rm_rf bundled_app('vendor')
bundle "install"
- bundled_app('vendor/gems/gems/rack-1.0.0').should be_directory
+ vendored_gems('gems/rack-1.0.0').should be_directory
should_be_installed "rack 1.0.0"
end
end
diff --git a/spec/support/path.rb b/spec/support/path.rb
index 8e95831363..81ab6b23b2 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -30,6 +30,11 @@ module Spec
root.join(*path)
end
+ def vendored_gems(path)
+ engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
+ bundled_app("vendor/#{engine}/#{RUBY_VERSION}/#{path}")
+ end
+
def cached_gem(path)
bundled_app("vendor/cache/#{path}.gem")
end