test: send a message using stdin

pull/1/head
Michael Santos 7 years ago
parent 6c4a14c712
commit ff86eb8f9a

@ -1,5 +1,10 @@
#!/usr/bin/env bats
[ "$XMPPIPE_USERNAME" ]
[ "$XMPPIPE_PASSWORD" ]
[ "$XMPPIPE_TEST_USERNAME" ]
[ "$XMPPIPE_TEST_PASSWORD" ]
@test "enter MUC" {
xmppipe < /dev/null | grep -q "^p:available"
}
@ -16,3 +21,8 @@
grep -q "^p:available:" $TMPDIR/stdout
grep -q $MESSAGE $TMPDIR/stderr
}
@test "sending/receive message: stdin" {
(sleep 10; echo 'test123 ~!@#$' | xmppipe -o xmppipe-test -r user1 -u $XMPPIPE_TEST_USERNAME -p $XMPPIPE_TEST_PASSWORD) &
xmppipe -o xmppipe-test -s | egrep "^m:groupchat:[^/]+/user1:[^:]+:test123%20~%21@%23%24%0A"
}

Loading…
Cancel
Save