diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-12-10 14:42:00 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-12-10 14:42:00 +0000 |
commit | 7cfa3956fd373db35948ef33cde652b30229f9ad (patch) | |
tree | e68d6df48818fb57d310ea504a32d9cc7d4c21b0 /spec/spec_helper.rb | |
parent | bc452f279ab8c57e4ec83e4e1e55d8847734a98d (diff) | |
parent | 308d338a172b11230bafa784f96fcf1eb5e6e981 (diff) |
Merge remote-tracking branch 'henare_github/relax-gc-for-tests' into develop
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9621211f5..4cf376624 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -46,6 +46,20 @@ Spec::Runner.configure do |config| :holidays, :track_things_sent_emails + # This section makes the garbage collector run less often to speed up tests + last_gc_run = Time.now + + config.before(:each) do + GC.disable + end + + config.after(:each) do + if Time.now - last_gc_run > 4 + GC.enable + GC.start + last_gc_run = Time.now + end + end # == Fixtures # |