File: server.rb

package info (click to toggle)
ruby-minitest 6.0.1%2Breally6.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 588 kB
  • sloc: ruby: 6,908; makefile: 13
file content (45 lines) | stat: -rw-r--r-- 702 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require "drb"
require "tmpdir"
require_relative "../minitest"

class Minitest::Server
  VERSION = "1.0.9"

  TOPDIR = Dir.pwd + "/"

  def self.path pid = $$
    "drbunix:#{Dir.tmpdir}/minitest.#{pid}"
  end

  def self.run client
    DRb.start_service path, new(client)
  end

  def self.stop
    DRb.stop_service
  end

  attr_accessor :client

  def initialize client
    self.client = client
  end

  def quit
    self.class.stop
  end

  def start
    client.minitest_start
  end

  def result file, klass, method, fails, assertions, time
    file = file.sub(/^#{TOPDIR}/, "")

    client.minitest_result file, klass, method, fails, assertions, time
  end

  def report
    # do nothing
  end
end