test/helper.rb in paperclip-3.5.2 vs test/helper.rb in paperclip-3.5.3

- old
+ new

@@ -24,23 +24,40 @@ `ruby -e 'exit 0'` # Prime $? with a value. begin require 'ruby-debug' -rescue LoadError => e +rescue LoadError puts "debugger disabled" end ROOT = Pathname(File.expand_path(File.join(File.dirname(__FILE__), '..'))) +$previous_count = 0 class Test::Unit::TestCase def setup silence_warnings do Object.const_set(:Rails, stub('Rails')) Rails.stubs(:root).returns(Pathname.new(ROOT).join('tmp')) Rails.stubs(:env).returns('test') Rails.stubs(:const_defined?).with(:Railtie).returns(false) end + end + + def teardown + end + + def report_files + files = [] + ObjectSpace.each_object(IO){|io| files << io unless io.closed? } + if files.count > $previous_count + puts __name__ + puts "#{files.count} files" + files.each do |file| + puts "Open IO: #{file.inspect}" + end + end + $previous_count = files.count end end $LOAD_PATH << File.join(ROOT, 'lib') $LOAD_PATH << File.join(ROOT, 'lib', 'paperclip')