diff options
-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: |