Sha256: 5ab9959481d916b2b2bd7b4c28f96d070cec5befe00e9f7bfab8d6f2cf7a2065

Contents?: true

Size: 495 Bytes

Versions: 14

Compression:

Stored size: 495 Bytes

Contents

require 'rails_helper'

describe "Memory Leak", :type => :request do

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

  [ActiveAdmin::Namespace, ActiveAdmin::Resource].each do |klass|
    it "should not leak #{klass}" do
      previously_disabled = GC.enable
      GC.start
      count = count_instances_of(klass)

      load_defaults!

      GC.start
      GC.disable if previously_disabled
      expect(count_instances_of klass).to be <= count
    end
  end

end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
yousty-activeadmin-1.0.17.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.16.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.15.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.14.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.13.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.12.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.11.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.10.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.9.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.8.pre spec/requests/memory_spec.rb
activeadmin-1.0.0.pre1 spec/requests/memory_spec.rb
yousty-activeadmin-1.0.7.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.6.pre spec/requests/memory_spec.rb
yousty-activeadmin-1.0.5.pre spec/requests/memory_spec.rb