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