diff options
author | Bundlerbot <bot@bundler.io> | 2018-11-16 02:44:32 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2018-11-16 02:44:32 +0000 |
commit | 172ec59db53ec05a91c0d9eb72e2d715ae82f3c0 (patch) | |
tree | d3f48e6c9f4f5c4fd35288c426ed2b3a15e817a2 /spec/commands | |
parent | 98040394795a8e5fd03d7e893f1a060041cd6777 (diff) | |
parent | 2aa84b2372371c4895cab4e096b48a34f88c451a (diff) | |
download | bundler-172ec59db53ec05a91c0d9eb72e2d715ae82f3c0.tar.gz |
Merge #6743
6743: Support file structure of ruby core repository. r=hsbt a=hsbt
### What was the end-user problem that led to this PR?
In the ruby core repository, I put bundler executable and bundler libraries under the `bin` and `lib` directories. It breaks the current behavior.
### What is your fix for the problem, implemented in this PR?
Support the structure of ruby core repository.
Co-authored-by: SHIBATA Hiroshi <hsbt@ruby-lang.org>
Diffstat (limited to 'spec/commands')
-rw-r--r-- | spec/commands/binstubs_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/clean_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 10 | ||||
-rw-r--r-- | spec/commands/info_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 5 | ||||
-rw-r--r-- | spec/commands/pristine_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 4 |
7 files changed, 16 insertions, 13 deletions
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index ad859a21d5..2f014f2631 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -202,7 +202,7 @@ RSpec.describe "bundle binstubs <gem>" do context "when requesting a different bundler version" do before { lockfile lockfile.gsub(Bundler::VERSION, "999.999.999") } - it "attempts to load that version" do + it "attempts to load that version", :ruby_repo do sys_exec bundled_app("bin/rackup").to_s expect(exitstatus).to eq(42) if exitstatus expect(last_command.stderr).to include("Activating bundler (999.999.999) failed:"). diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index ff3317bb1d..37cbeeb4e7 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -712,7 +712,7 @@ RSpec.describe "bundle clean" do should_not_have_gems "foo-1.0" end - it "doesn't remove extensions artifacts from bundled git gems after clean", :rubygems => "2.2" do + it "doesn't remove extensions artifacts from bundled git gems after clean", :ruby_repo, :rubygems => "2.2" do build_git "very_simple_git_binary", &:add_c_extension revision = revision_for(lib_path("very_simple_git_binary-1.0")) @@ -734,7 +734,7 @@ RSpec.describe "bundle clean" do expect(vendored_gems("bundler/gems/very_simple_git_binary-1.0-#{revision[0..11]}")).to exist end - it "removes extension directories", :rubygems => "2.2" do + it "removes extension directories", :ruby_repo, :rubygems => "2.2" do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index acf12ced79..fdf60cefe7 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -33,7 +33,7 @@ RSpec.describe "bundle exec" do expect(out).to eq("1.0.0") end - it "works when running from a random directory" do + it "works when running from a random directory", :ruby_repo do install_gemfile <<-G gem "rack" G @@ -226,7 +226,7 @@ RSpec.describe "bundle exec" do expect(out).to include("bundler: exec needs a command to run") end - it "raises a helpful error when exec'ing to something outside of the bundle", :rubygems => ">= 2.5.2" do + it "raises a helpful error when exec'ing to something outside of the bundle", :ruby_repo, :rubygems => ">= 2.5.2" do bundle! "config clean false" # want to keep the rackup binstub install_gemfile! <<-G source "file://#{gem_repo1}" @@ -342,7 +342,7 @@ RSpec.describe "bundle exec" do end describe "with gem executables" do - describe "run from a random directory" do + describe "run from a random directory", :ruby_repo do before(:each) do install_gemfile <<-G gem "rack" @@ -445,7 +445,7 @@ RSpec.describe "bundle exec" do expect(out).to include("Installing foo 1.0") end - describe "with gems bundled via :path with invalid gemspecs" do + describe "with gems bundled via :path with invalid gemspecs", :ruby_repo do it "outputs the gemspec validation errors", :rubygems => ">= 1.7.2" do build_lib "foo" @@ -633,7 +633,7 @@ RSpec.describe "bundle exec" do it_behaves_like "it runs" end - context "when the file uses the current ruby shebang" do + context "when the file uses the current ruby shebang", :ruby_repo do let(:shebang) { "#!#{Gem.ruby}" } it_behaves_like "it runs" end diff --git a/spec/commands/info_spec.rb b/spec/commands/info_spec.rb index a08965ec0e..a9ab8fc210 100644 --- a/spec/commands/info_spec.rb +++ b/spec/commands/info_spec.rb @@ -24,7 +24,7 @@ RSpec.describe "bundle info" do end end - context "given a default gem shippped in ruby" do + context "given a default gem shippped in ruby", :ruby_repo do it "prints information about the default gem", :if => (RUBY_VERSION >= "2.0") do bundle "info rdoc" expect(out).to include("* rdoc") diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 8f033e5b4f..2914ba66c5 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -197,7 +197,10 @@ RSpec.describe "bundle gem" do end Dir.chdir(bundled_app("newgem")) do - system_gems ["rake-10.0.2", :bundler], :path => :bundle_path + gems = ["rake-10.0.2", :bundler] + # for Ruby core repository, Ruby 2.6+ has bundler as standard library. + gems.delete(:bundler) if ruby_core? + system_gems gems, :path => :bundle_path bundle! "exec rake build" end diff --git a/spec/commands/pristine_spec.rb b/spec/commands/pristine_spec.rb index 3ce6636f9f..a868465c03 100644 --- a/spec/commands/pristine_spec.rb +++ b/spec/commands/pristine_spec.rb @@ -2,7 +2,7 @@ require "bundler/vendored_fileutils" -RSpec.describe "bundle pristine" do +RSpec.describe "bundle pristine", :ruby_repo do before :each do build_lib "baz", :path => bundled_app do |s| s.version = "1.0.0" diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 102b9534de..369d0d708a 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -60,12 +60,12 @@ RSpec.describe "bundle show" do and include(default_bundle_path("gems", "rails-2.3.2").to_s) end - it "prints the path to the running bundler", :bundler => "< 2" do + it "prints the path to the running bundler", :ruby_repo, :bundler => "< 2" do bundle "show bundler" expect(out).to eq(root.to_s) end - it "prints the path to the running bundler", :bundler => "2" do + it "prints the path to the running bundler", :ruby_repo, :bundler => "2" do bundle "show bundler" expect(out).to eq( "[DEPRECATED FOR 2.0] use `bundle info bundler` instead of `bundle show bundler`\n" + |