ketracel/spec/ngircd_harness_spec.moon

44 lines
987 B
Plaintext

irce = require "irce"
socket = require "socket"
test = require "ketracel.test"
Server = require("ketracel.server").Server
uuid = require "uuid"
describe "ngircd protocol support", ->
local server
local client
setup ->
print "got here"
file = io.popen "ngircd -n -f ./spec/ngircd.conf", "r"
server = Server
server: "127.0.0.1"
sname: "ketracel.akua"
spass: "hunter2"
sreal: "Ketracel"
nicklen: "31"
debug: true
client = test.Client "test_user"
teardown ->
with io.popen "killall ngircd", "r"
\close!
it "actually is running ngircd", ->
with io.popen "pstree"
data = \read "*all"
assert.truthy string.find data, "ngircd"
it "registers", ->
server\wait_for "376"
it "can use the Client class", ->
client\wait_for "005"
it "sees the client", ->
server\wait_for "NICK"
it "sees the client join a new channel", ->
client.irc\JOIN "#" .. uuid()
server\wait_for "JOIN"