Sha256: 83a3a5873fe2a539cfd5a3948c9c44d1e0aa8c455a0e9f53da19821ff104f004
Contents?: true
Size: 468 Bytes
Versions: 14
Compression:
Stored size: 468 Bytes
Contents
module Plugins; end module Plugins::TestHelper # Captures output produced with print. def capture_output begin output = "" Kernel.class_eval do alias_method :no_print_for_now, :print define_method(:print) { |*args| output << args.join } end yield return output ensure Kernel.class_eval do alias_method :print, :no_print_for_now undef no_print_for_now end end end end
Version data entries
14 entries across 14 versions & 2 rubygems