blob: 4ebc40af11e633b1378b303f201cbead174cbf22 (
plain)
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
|
require 'minitest/autorun'
require 'minitest/pride'
class FunctionalTest < Minitest::Test
protected
def nickserver_pid
status = nickserver "status"
/process id (\d*)\./.match(status)[1]
end
def assert_running
status = nickserver "status"
assert_includes status, "Nickserver running"
end
def assert_stopped
status = nickserver "status"
assert_includes status, "No nickserver processes are running."
end
def assert_command_runs(command)
out = nickserver command
assert ($?.exitstatus == 0),
"failed to run 'nickserver #{command}':\n #{out}"
end
def nickserver(command)
self.class.nickserver command
end
def self.nickserver(command)
`#{path_to_executable} #{command} 2>&1`
end
def self.path_to_executable
File.expand_path(File.dirname(__FILE__) + '/../../bin/nickserver')
end
end
|