summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2019-02-19 22:35:15 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2019-02-19 22:35:15 +0900
commit0c95d6dcad318737c36b139337ed5913b88f23ff (patch)
tree96be57945ee57d595cec44394a59b22b15aa116c
parent5dc368b07c407702a485ed53d8fd8a8ab40fa9ef (diff)
downloadbundler-0c95d6dcad318737c36b139337ed5913b88f23ff.tar.gz
The ruby core applied the difference structure from bundler upstream
repository. We need to modify a configuration for test-bundler.
-rw-r--r--spec/quality_spec.rb14
-rw-r--r--spec/support/helpers.rb12
2 files changed, 19 insertions, 7 deletions
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index f800ceeebd..ce57c20e5c 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -216,7 +216,16 @@ RSpec.describe "The library itself" do
it "can still be built" do
Dir.chdir(root) do
begin
- gem_command! :build, gemspec
+ if ruby_core?
+ spec = Gem::Specification.load(gemspec.to_s)
+ spec.bindir = "libexec"
+ File.open(root.join("bundler.gemspec").to_s, "w"){|f| f.write spec.to_ruby }
+ gem_command! :build, root.join("bundler.gemspec").to_s
+ FileUtils.rm(root.join("bundler.gemspec").to_s)
+ else
+ gem_command! :build, gemspec
+ end
+
if Bundler.rubygems.provides?(">= 2.4")
# there's no way around this warning
last_command.stderr.sub!(/^YAML safe loading.*/, "")
@@ -227,8 +236,7 @@ RSpec.describe "The library itself" do
end
ensure
# clean up the .gem generated
- path_prefix = ruby_core? ? "lib/" : "./"
- FileUtils.rm("#{path_prefix}bundler-#{Bundler::VERSION}.gem")
+ FileUtils.rm("bundler-#{Bundler::VERSION}.gem")
end
end
end
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 563af1eab3..41b2004c19 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -308,12 +308,16 @@ module Spec
gem_repo = options.fetch(:gem_repo) { gem_repo1 }
gems.each do |g|
path = if g == :bundler
- Dir.chdir(root) { gem_command! :build, gemspec.to_s }
- bundler_path = if ruby_core?
- root + "lib/bundler-#{Bundler::VERSION}.gem"
+ if ruby_core?
+ spec = Gem::Specification.load(gemspec.to_s)
+ spec.bindir = "libexec"
+ File.open(root.join("bundler.gemspec").to_s, "w"){|f| f.write spec.to_ruby }
+ Dir.chdir(root) { gem_command! :build, root.join("bundler.gemspec").to_s }
+ FileUtils.rm(root.join("bundler.gemspec"))
else
- root + "bundler-#{Bundler::VERSION}.gem"
+ Dir.chdir(root) { gem_command! :build, gemspec.to_s }
end
+ bundler_path = root + "bundler-#{Bundler::VERSION}.gem"
elsif g.to_s =~ %r{\A/.*\.gem\z}
g
else