Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more
# File test/unit.rb, line 292
def died(*additional)
@status = :quit
@io.close
call_hook(:dead,*additional)
end
# File test/unit.rb, line 276
def hook(id,&block)
@hooks[id] ||= []
@hooks[id] << block
self
end
# File test/unit.rb, line 256
def puts(*args)
@io.puts(*args)
end
# File test/unit.rb, line 282
def read
res = (@status == :quit) ? @io.read : @io.gets
res && res.chomp
end
# File test/unit.rb, line 260
def run(task,type)
@file = File.basename(task).gsub(/\.rb/,"")
@real_file = task
begin
puts "loadpath #{[Marshal.dump($:-@loadpath)].pack("m").gsub("\n","")}"
@loadpath = $:.dup
puts "run #{task} #{type}"
@status = :prepare
rescue Errno::EPIPE
died
rescue IOError
raise unless ["stream closed","closed stream"].include? $!.message
died
end
end