summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 18:46:42 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 08:43:53 +0200
commit32520c7020419601669b7b82b500d61d8d4410b1 (patch)
treecf95da1812c91fa9aee66a75651ca767fbfae4db
parent5b503a4bf1047a231c7b34d1502677264ed9e554 (diff)
downloadbundler-32520c7020419601669b7b82b500d61d8d4410b1.tar.gz
Make sure gem has been built before deleteng it
-rw-r--r--spec/quality_spec.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index c3f2fe23b7..bcb9412d4d 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -226,20 +226,22 @@ RSpec.describe "The library itself" do
it "can still be built" do
Dir.chdir(root) do
- begin
- 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")
- FileUtils.rm(root.join("bundler.gemspec"))
- else
- gem_command! :build, gemspec
- end
+ 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")
+ FileUtils.rm(root.join("bundler.gemspec"))
+ else
+ gem_command! :build, gemspec
+ end
+ bundler_path = root.join("bundler-#{Bundler::VERSION}.gem")
+
+ begin
expect(err).to be_empty, "bundler should build as a gem without warnings, but\n#{err}"
ensure
- root.join("bundler-#{Bundler::VERSION}.gem").rmtree
+ bundler_path.rmtree
end
end
end