mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
19 lines
391 B
Ruby
19 lines
391 B
Ruby
require 'test/unit'
|
|
require 'puma/cli'
|
|
require 'tempfile'
|
|
|
|
class TestCLI < Test::Unit::TestCase
|
|
def setup
|
|
@pid_file = Tempfile.new("puma-test")
|
|
@pid_path = @pid_file.path
|
|
@pid_file.close!
|
|
end
|
|
|
|
def test_pid_file
|
|
cli = Puma::CLI.new ["--pidfile", @pid_path]
|
|
cli.parse_options
|
|
cli.write_pid
|
|
|
|
assert_equal File.read(@pid_path).strip.to_i, Process.pid
|
|
end
|
|
end
|