spongy

A Unixy IRC client
git clone https://git.woozle.org/neale/spongy.git

spongy / spongyd
Neale Pickett  ·  2016-01-18

spongy_test.go

 1package main
 2
 3import (
 4	"io/ioutil"
 5	"os"
 6	"path"
 7	"testing"
 8)
 9
10func setupRunSpongy(t *testing.T, parent string, baseChan chan<- string) {
11	base, _ := createNetwork(t, parent)
12	baseChan <- base
13	close(baseChan)
14	runsvdir(parent)
15	os.RemoveAll(base)
16}
17
18func TestRunsvdir(t *testing.T) {
19	parent, err := ioutil.TempDir("", "spongy-test")
20	if err != nil {
21		t.Fatal(err)
22	}
23	defer os.RemoveAll(parent)
24
25	baseChan := make(chan string)
26	go setupRunSpongy(t, parent, baseChan)
27	
28	base := <- baseChan
29	expect(t, path.Join(base, "log", "current"), " 001 ")
30	os.RemoveAll(base)
31}