diff options
-rw-r--r-- | lib/bundler.rb | 2 | ||||
-rw-r--r-- | spec/install/gems_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/git_spec.rb | 4 | ||||
-rw-r--r-- | spec/support/path.rb | 4 |
4 files changed, 10 insertions, 2 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 71d7640d3b..e53c1fec5e 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -96,7 +96,7 @@ module Bundler end def cache - home.join("cache") + bundle_path.join('cache/bundler') end def root diff --git a/spec/install/gems_spec.rb b/spec/install/gems_spec.rb index 70e0b66366..d36f10daf4 100644 --- a/spec/install/gems_spec.rb +++ b/spec/install/gems_spec.rb @@ -16,7 +16,7 @@ describe "gemfile install with gem sources" do gem 'rack' G - home(".bundle/#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}/gems/rack-1.0.0").should exist + default_bundle_path("gems/rack-1.0.0").should exist should_be_installed("rack 1.0.0") end diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index 8d6984383a..abeb10baea 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -24,6 +24,10 @@ describe "gemfile install with git sources" do out.should == "WIN" end + it "caches the git repo" do + default_bundle_path('cache/bundler/git/foo-1.0-2da26eec78721fc54f4cc2709816e1cd504a4e82').should exist + end + it "floats on master if no ref is specified" do update_git "foo" diff --git a/spec/support/path.rb b/spec/support/path.rb index 602c6117ad..ceb0ed8096 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -12,6 +12,10 @@ module Spec tmp.join("home", *path) end + def default_bundle_path(*path) + home(".bundle/#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}", *path) + end + def bundled_app(*path) root = tmp.join("bundled_app") FileUtils.mkdir_p(root) |