diff options
author | Andre Arko <andre@arko.net> | 2014-04-13 14:05:56 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-04-13 14:07:03 -0700 |
commit | 1ed2c909489927cc1e80e68196709d9e86a5a3eb (patch) | |
tree | 0e5a9a9a09d51e7c8b4fec98cb736127bf2c3248 /spec | |
parent | 112c3f418d95a9e876792e0e62bc886e44e65e55 (diff) | |
download | bundler-1ed2c909489927cc1e80e68196709d9e86a5a3eb.tar.gz |
cache gems even if they are ruby builtins
Diffstat (limited to 'spec')
-rw-r--r-- | spec/cache/gems_spec.rb | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb index 9b6c3979af..3ba98b7730 100644 --- a/spec/cache/gems_spec.rb +++ b/spec/cache/gems_spec.rb @@ -74,39 +74,34 @@ describe "bundle cache" do end end - describe "when there is a built-in gem" do - let(:version) { "1.0.0" } - + describe "when there is a built-in gem", :ruby => "2.0" do before :each do build_repo2 do - build_gem "builtin_gem", version do |s| - s.summary = "This builtin_gem is bundled with Ruby" - end - - build_gem "remote_gem", version do |s| - s.summary = "Totally normal gem" - end + build_gem "builtin_gem", "1.0.2" end - build_gem "builtin_gem", version, :to_system => true do |s| + build_gem "builtin_gem", "1.0.2", :to_system => true do |s| s.summary = "This builtin_gem is bundled with Ruby" end - install_gemfile <<-G - source "file://#{gem_repo2}" - gem 'builtin_gem', '#{version}' - gem 'remote_gem', '#{version}' - G + FileUtils.rm("#{system_gem_path}/cache/builtin_gem-1.0.2.gem") + end - FileUtils.rm("#{system_gem_path}/cache/builtin_gem-#{version}.gem") + it "uses builtin gems" do + install_gemfile %|gem 'builtin_gem', '1.0.2'| + should_be_installed("builtin_gem 1.0.2") end - it "caches normal gems successfully" do - bundle :cache, :exitstatus => true + it "caches remote and builtin gems" do + install_gemfile <<-G + source "file://#{gem_repo2}" + gem 'builtin_gem', '1.0.2' + gem 'rack', '1.0.0' + G - expect(exitstatus).to be_zero - expect(bundled_app("vendor/cache/builtin_gem-#{version}.gem")).to_not exist - expect(bundled_app("vendor/cache/remote_gem-#{version}.gem")).to exist + bundle :cache + expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist + expect(bundled_app("vendor/cache/builtin_gem-1.0.2.gem")).to exist end end |