summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 18:48:09 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 08:43:54 +0200
commit07161ebc1a271de20510a25b4ab9568aae1af871 (patch)
treecb492086cabb811db2de867b7487753979ea15c9
parent32520c7020419601669b7b82b500d61d8d4410b1 (diff)
downloadbundler-07161ebc1a271de20510a25b4ab9568aae1af871.tar.gz
Only chdir when necessary
-rw-r--r--spec/quality_spec.rb30
1 files changed, 14 insertions, 16 deletions
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index bcb9412d4d..40e1a113f0 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -225,24 +225,22 @@ RSpec.describe "The library itself" do
end
it "can still be built" do
- Dir.chdir(root) do
- 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 }
+ Dir.chdir(root) { gem_command! :build, root.join("bundler.gemspec") }
+ FileUtils.rm(root.join("bundler.gemspec"))
+ else
+ Dir.chdir(root) { gem_command! :build, gemspec }
+ end
- bundler_path = root.join("bundler-#{Bundler::VERSION}.gem")
+ 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
- bundler_path.rmtree
- end
+ begin
+ expect(err).to be_empty, "bundler should build as a gem without warnings, but\n#{err}"
+ ensure
+ bundler_path.rmtree
end
end