mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[bundler/bundler] Only chdir when necessary
https://github.com/bundler/bundler/commit/07161ebc1a
This commit is contained in:
parent
580e093fdd
commit
20c5154f0b
1 changed files with 14 additions and 16 deletions
|
@ -225,24 +225,22 @@ RSpec.describe "The library itself" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "can still be built" do
|
it "can still be built" do
|
||||||
Dir.chdir(root) do
|
if ruby_core?
|
||||||
if ruby_core?
|
spec = Gem::Specification.load(gemspec.to_s)
|
||||||
spec = Gem::Specification.load(gemspec.to_s)
|
spec.bindir = "libexec"
|
||||||
spec.bindir = "libexec"
|
File.open(root.join("bundler.gemspec").to_s, "w") {|f| f.write spec.to_ruby }
|
||||||
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") }
|
||||||
gem_command! :build, root.join("bundler.gemspec")
|
FileUtils.rm(root.join("bundler.gemspec"))
|
||||||
FileUtils.rm(root.join("bundler.gemspec"))
|
else
|
||||||
else
|
Dir.chdir(root) { gem_command! :build, gemspec }
|
||||||
gem_command! :build, gemspec
|
end
|
||||||
end
|
|
||||||
|
|
||||||
bundler_path = root.join("bundler-#{Bundler::VERSION}.gem")
|
bundler_path = root.join("bundler-#{Bundler::VERSION}.gem")
|
||||||
|
|
||||||
begin
|
begin
|
||||||
expect(err).to be_empty, "bundler should build as a gem without warnings, but\n#{err}"
|
expect(err).to be_empty, "bundler should build as a gem without warnings, but\n#{err}"
|
||||||
ensure
|
ensure
|
||||||
bundler_path.rmtree
|
bundler_path.rmtree
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue