diff options
author | Henare Degan <henare.degan@gmail.com> | 2013-02-19 15:08:28 +1100 |
---|---|---|
committer | Henare Degan <henare.degan@gmail.com> | 2013-02-19 15:08:28 +1100 |
commit | 3f4e595d96b2932c07098435dbe28248b1852248 (patch) | |
tree | bf47f8614fdcbc321279a29dd16a01520102c4ed | |
parent | 1820c346e06fbd56a3a9b3c6b39b328084d08fa5 (diff) |
Speed up tests by brining the garbage collection hack over too
-rw-r--r-- | spec/spec_helper.rb | 14 | ||||
-rw-r--r-- | spec/spec_helper.rb.rails2 | 15 |
2 files changed, 14 insertions, 15 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bcc00bec2..eaf77a909 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -73,6 +73,20 @@ Spork.prefork do ActionMailer::Base.deliveries = [] end + # 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 end # XXX No idea what namespace/class/module to put this in diff --git a/spec/spec_helper.rb.rails2 b/spec/spec_helper.rb.rails2 index aee3ce122..1a6aa4a09 100644 --- a/spec/spec_helper.rb.rails2 +++ b/spec/spec_helper.rb.rails2 @@ -43,21 +43,6 @@ 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 # # You can declare fixtures for each example_group like this: |