diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-22 23:08:05 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-22 23:08:05 +0000 |
commit | 7825e8363d4b2ccad8e2d3f5eeba9e26f6656911 (patch) | |
tree | 83cbcf419e0feeb2ab0fd063ed85e0776eb0081b /spec/bundler/cache/path_spec.rb | |
parent | 73bed0312895322e0fd18310e840356c8e6af812 (diff) |
Postponing the Bundler merge.
I faced a big issue about Bundler with ruby core.
I have no time to resolve it issue before 2.5 final release.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler/cache/path_spec.rb')
-rw-r--r-- | spec/bundler/cache/path_spec.rb | 139 |
1 files changed, 0 insertions, 139 deletions
diff --git a/spec/bundler/cache/path_spec.rb b/spec/bundler/cache/path_spec.rb deleted file mode 100644 index 8c6a843476..0000000000 --- a/spec/bundler/cache/path_spec.rb +++ /dev/null @@ -1,139 +0,0 @@ -# frozen_string_literal: true - -%w[cache package].each do |cmd| - RSpec.describe "bundle #{cmd} with path" do - it "is no-op when the path is within the bundle" do - build_lib "foo", :path => bundled_app("lib/foo") - - install_gemfile <<-G - gem "foo", :path => '#{bundled_app("lib/foo")}' - G - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - expect(bundled_app("vendor/cache/foo-1.0")).not_to exist - expect(the_bundle).to include_gems "foo 1.0" - end - - it "copies when the path is outside the bundle " do - build_lib "foo" - - install_gemfile <<-G - gem "foo", :path => '#{lib_path("foo-1.0")}' - G - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - expect(bundled_app("vendor/cache/foo-1.0")).to exist - expect(bundled_app("vendor/cache/foo-1.0/.bundlecache")).to be_file - - FileUtils.rm_rf lib_path("foo-1.0") - expect(the_bundle).to include_gems "foo 1.0" - end - - it "copies when the path is outside the bundle and the paths intersect" do - libname = File.basename(Dir.pwd) + "_gem" - libpath = File.join(File.dirname(Dir.pwd), libname) - - build_lib libname, :path => libpath - - install_gemfile <<-G - gem "#{libname}", :path => '#{libpath}' - G - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - expect(bundled_app("vendor/cache/#{libname}")).to exist - expect(bundled_app("vendor/cache/#{libname}/.bundlecache")).to be_file - - FileUtils.rm_rf libpath - expect(the_bundle).to include_gems "#{libname} 1.0" - end - - it "updates the path on each cache" do - build_lib "foo" - - install_gemfile <<-G - gem "foo", :path => '#{lib_path("foo-1.0")}' - G - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - - build_lib "foo" do |s| - s.write "lib/foo.rb", "puts :CACHE" - end - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - - expect(bundled_app("vendor/cache/foo-1.0")).to exist - FileUtils.rm_rf lib_path("foo-1.0") - - run "require 'foo'" - expect(out).to eq("CACHE") - end - - it "removes stale entries cache" do - build_lib "foo" - - install_gemfile <<-G - gem "foo", :path => '#{lib_path("foo-1.0")}' - G - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - - install_gemfile <<-G - gem "bar", :path => '#{lib_path("bar-1.0")}' - G - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - expect(bundled_app("vendor/cache/bar-1.0")).not_to exist - end - - it "raises a warning without --all", :bundler => "< 2" do - build_lib "foo" - - install_gemfile <<-G - gem "foo", :path => '#{lib_path("foo-1.0")}' - G - - bundle cmd - expect(out).to match(/please pass the \-\-all flag/) - expect(bundled_app("vendor/cache/foo-1.0")).not_to exist - end - - it "stores the given flag" do - build_lib "foo" - - install_gemfile <<-G - gem "foo", :path => '#{lib_path("foo-1.0")}' - G - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - build_lib "bar" - - install_gemfile <<-G - gem "foo", :path => '#{lib_path("foo-1.0")}' - gem "bar", :path => '#{lib_path("bar-1.0")}' - G - - bundle cmd - expect(bundled_app("vendor/cache/bar-1.0")).to exist - end - - it "can rewind chosen configuration" do - build_lib "foo" - - install_gemfile <<-G - gem "foo", :path => '#{lib_path("foo-1.0")}' - G - - bundle cmd, forgotten_command_line_options([:all, :cache_all] => true) - build_lib "baz" - - gemfile <<-G - gem "foo", :path => '#{lib_path("foo-1.0")}' - gem "baz", :path => '#{lib_path("baz-1.0")}' - G - - bundle "#{cmd} --no-all" - expect(bundled_app("vendor/cache/baz-1.0")).not_to exist - end - end -end |