Skip to content

Commit

Permalink
Add gc_hacks that speeds up the tests slightly
Browse files Browse the repository at this point in the history
70 second improvement (290 -> 220) on my machine
  • Loading branch information
radar committed Nov 23, 2011
1 parent 7b8f26b commit 1477ac7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/spec/support/gc_hacks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# From: http://www.rubyinside.com/careful-cutting-to-get-faster-rspec-runs-with-rails-5207.html
counter = -1
RSpec.configure do |config|
config.after(:each) do
counter += 1
if counter > 9
GC.enable
GC.start
GC.disable
counter = 0
end
end

config.after(:suite) do
counter = 0
end
end

0 comments on commit 1477ac7

Please sign in to comment.