Module: Async::RSpec::Leaks

Defined in:
lib/async/rspec/leaks.rb

Instance Method Summary collapse

Instance Method Details

#current_ios(gc: GC.start) ⇒ Object



24
25
26
27
28
29
# File 'lib/async/rspec/leaks.rb', line 24

def current_ios(gc: GC.start)
	all_ios = ObjectSpace.each_object(::IO).to_a.sort_by(&:object_id)
	
	# We are not interested in ios that have been closed already:
	return all_ios.reject{|io| io.closed?}
end