Sha256: 6ac79016578f52c7060b8bc8997c9fd6bc1d06202fe8b51f4b02ff3f8abe6313

Contents?: true

Size: 517 Bytes

Versions: 11

Compression:

Stored size: 517 Bytes

Contents

require 'rails_helper'

describe "Memory Leak", type: :request, if: RUBY_ENGINE == 'ruby' 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

11 entries across 11 versions & 3 rubygems

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/memory_spec.rb
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/memory_spec.rb
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/memory_spec.rb
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/memory_spec.rb
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/spec/requests/memory_spec.rb
activeadmin-orac-1.0.0.pre4 spec/requests/memory_spec.rb
activeadmin-orac-1.0.0 spec/requests/memory_spec.rb
activeadmin-orac-1.0.0.pre.orac spec/requests/memory_spec.rb
activeadmin-1.0.0.pre4 spec/requests/memory_spec.rb
activeadmin-1.0.0.pre3 spec/requests/memory_spec.rb
activeadmin-1.0.0.pre2 spec/requests/memory_spec.rb