diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-01-05 15:21:38 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-01-05 15:24:49 +0100 |
commit | 18cde3b606ecc88a47a2a856de79db8482b5fb25 (patch) | |
tree | 241e85611f3e2b28be19712b8832423ad23c390b | |
parent | 1daae58d9a139425d6a0a4d940b04ad3af08bb9f (diff) | |
download | bundler-18cde3b606ecc88a47a2a856de79db8482b5fb25.tar.gz |
Disallow folder changing helpers without a block
Since their naming leads to code that reads a bit weird without a block.
-rw-r--r-- | spec/spec_helper.rb | 4 | ||||
-rw-r--r-- | spec/support/path.rb | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0a49b46aaa..a4e99a6dd8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -105,7 +105,9 @@ RSpec.configure do |config| ENV.replace(original_env) reset! system_gems [] - in_app_root + + Dir.chdir(bundled_app) + @command_executions = [] Bundler.ui.silence { example.run } diff --git a/spec/support/path.rb b/spec/support/path.rb index 9596724cc0..0c80fe5551 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -180,16 +180,16 @@ module Spec end end - def in_app_root(&blk) - Dir.chdir(bundled_app, &blk) + def in_app_root + Dir.chdir(bundled_app) { yield } end - def in_app_root2(&blk) - Dir.chdir(bundled_app2, &blk) + def in_app_root2 + Dir.chdir(bundled_app2) { yield } end - def in_repo_root(&blk) - Dir.chdir(root, &blk) + def in_repo_root + Dir.chdir(root) { yield } end extend self |