mirror of
https://github.com/msantos/xmppipe
synced 2024-11-13 13:10:32 +00:00
tests: add some basic tests
Check the the basic functionality of xmppipe: # https://github.com/sstephenson/bats # apt-get install bats bats test
This commit is contained in:
parent
7f0b5863c0
commit
417176cddb
18
test/10-groupchat.bats
Normal file
18
test/10-groupchat.bats
Normal file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
@test "enter MUC" {
|
||||
xmppipe < /dev/null | grep -q "^p:available"
|
||||
}
|
||||
|
||||
@test "send groupchat" {
|
||||
MESSAGE="test-$$"
|
||||
echo $MESSAGE | xmppipe -vv 2>&1 | grep -q $MESSAGE
|
||||
}
|
||||
|
||||
@test "redirect stdout/stderr to files" {
|
||||
TMPDIR=$(mktemp -d)
|
||||
MESSAGE="test-$$"
|
||||
echo $MESSAGE | xmppipe -vv > $TMPDIR/stdout 2> $TMPDIR/stderr
|
||||
grep -q "^p:available:" $TMPDIR/stdout
|
||||
grep -q $MESSAGE $TMPDIR/stderr
|
||||
}
|
Loading…
Reference in New Issue
Block a user