Skip to content

Commit 51e8900

Browse files
deivid-rodriguezhsbt
authored andcommitted
[rubygems/rubygems] Reset tmp directories before spec suite
If you abort running test suite with a quick double Ctrl-C, tmp files will be left around, and they will interfere with the next test run. To avoid this, make sure to clear them once at the beginning of the test suite. ### Before ``` $ bin/parallel_rspec 16 processes for 175 specs, ~ 11 specs per process .............................................................................................^C^C Finished in 19.45 seconds (files took 0.42722 seconds to load) 94 examples, 0 failures (... turbo tests backtrace ...) $ bin/parallel_rspec 16 processes for 175 specs, ~ 11 specs per process .F....F....F...F......^C Failures: (... failures' details ...) ``` ### After ``` $ bin/parallel_rspec 16 processes for 175 specs, ~ 11 specs per process .................................................................................^C^C Finished in 18.18 seconds (files took 0.4383 seconds to load) 82 examples, 0 failures (... turbo tests backtrace ...) $ bin/parallel_rspec 16 processes for 175 specs, ~ 11 specs per process ................................................................................^C^C Finished in 8.79 seconds (files took 0.45187 seconds to load) 80 examples, 0 failures (... turbo tests backtrace ...) ``` ruby/rubygems@6767a52711
1 parent 7dc2841 commit 51e8900

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

spec/bundler/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def self.ruby=(ruby)
103103

104104
build_repo1
105105

106-
reset_paths!
106+
reset!
107107
end
108108

109109
config.around :each do |example|

spec/bundler/support/helpers.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ def reset!
2424
end
2525
FileUtils.mkdir_p(home)
2626
FileUtils.mkdir_p(tmpdir)
27-
reset_paths!
28-
end
29-
30-
def reset_paths!
3127
Bundler.reset!
3228
Gem.clear_paths
3329
end

0 commit comments

Comments
 (0)