Sha256: 9cae995a30365d8d974ce2e7d6f5c2c6ab8b5919f81a897d2f4c793bb51c3deb

Contents?: true

Size: 779 Bytes

Versions: 12

Compression:

Stored size: 779 Bytes

Contents

require 'spec_helper'

# These tests show the memory leak that is currently in Active Admin. They
# are all marked as pending until they pass. To work on them, comment out the
# pending method call in #it_should_not_leak
describe "Memory Leak" do

  def count_instances_of(klass)
    ObjectSpace.each_object(klass) { }
  end

  def self.it_should_not_leak(klass)
    it "should not leak #{klass}" do
      previously_disabled = GC.enable # returns true if the garbage collector was disabled
      GC.start
      count = count_instances_of(klass)

      load_defaults!

      GC.start
      GC.disable if previously_disabled
      count_instances_of(klass).should <= count
    end
  end

  it_should_not_leak ActiveAdmin::Namespace
  it_should_not_leak ActiveAdmin::Resource

end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
activeadmin-0.6.6 spec/integration/memory_spec.rb
activeadmin-0.6.5 spec/integration/memory_spec.rb
activeadmin-0.6.4 spec/integration/memory_spec.rb
yousty-activeadmin-1.0.4.pre spec/integration/memory_spec.rb
yousty-activeadmin-1.0.3.pre spec/integration/memory_spec.rb
yousty-activeadmin-1.0.2.pre spec/integration/memory_spec.rb
activeadmin-0.6.3 spec/integration/memory_spec.rb
yousty-activeadmin-1.0.1.pre spec/integration/memory_spec.rb
yousty-activeadmin-1.0.0.pre spec/integration/memory_spec.rb
activeadmin-0.6.2 spec/integration/memory_spec.rb
activeadmin-0.6.1 spec/integration/memory_spec.rb
aa-rails4-0.6.0 spec/integration/memory_spec.rb