Class: Minitest::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest/server.rb

Constant Summary collapse

VERSION =
"1.0.10"
TOPDIR =
Dir.pwd + "/"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Server

Returns a new instance of Server.



29
30
31
# File 'lib/minitest/server.rb', line 29

def initialize client
  self.client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



27
28
29
# File 'lib/minitest/server.rb', line 27

def client
  @client
end

Class Method Details

.path(pid = $$) ⇒ Object



15
16
17
# File 'lib/minitest/server.rb', line 15

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

.run(client) ⇒ Object



19
20
21
# File 'lib/minitest/server.rb', line 19

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

.stopObject



23
24
25
# File 'lib/minitest/server.rb', line 23

def self.stop
  DRb.stop_service
end

Instance Method Details

#quitObject



33
34
35
# File 'lib/minitest/server.rb', line 33

def quit
  self.class.stop
end

#reportObject



47
48
49
# File 'lib/minitest/server.rb', line 47

def report
  # do nothing
end

#result(file, klass, method, fails, assertions, time) ⇒ Object



41
42
43
44
45
# File 'lib/minitest/server.rb', line 41

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

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

#startObject



37
38
39
# File 'lib/minitest/server.rb', line 37

def start
  client.minitest_start
end