~anjan/sxmo-check

f4fd43841f8c171a0eac7e311baa4589852761dc — Anjandev Momi 1 year, 10 months ago 6173e90
text_spec.sh: longtext as seperate text, add emoji test
1 files changed, 16 insertions(+), 2 deletions(-)

M spec/text_spec.sh
M spec/text_spec.sh => spec/text_spec.sh +16 -2
@@ 1,7 1,8 @@
#!/bin/sh

%const NAME: value
% DATE: "$(date) $(cat /dev/urandom | base64 | head -n 1)"
% DATE: "$(date)"
% LONGTEXT: "$(cat /dev/urandom | base64 | head -n 1)"

Describe "receiving"
  Include lib/text.sh


@@ 9,14 10,19 @@ Describe "receiving"
    When call recieving "Receiving plain text at $DATE" ShellSpec
    The output should equal "Receiving plain text at $DATE"
  End
  It 'Can receive emoji message on pinephone'
    When call recieving "Receiving emoji text at 🤔 🤣$DATE" ShellSpec
    The output should equal "Receiving emoji text at 🤔 🤣$DATE"
  End
End
Describe "sending"
  Include lib/text.sh
  # This is inspired by https://github.com/shellspec/shellspec/issues/199
  setup() {
	. ./.secrets
    ./go-sendxmpp -l > /tmp/recv &
    sleep 1
    pid=$!
    sleep 1
  }
  BeforeRun setup
  cleanup() {


@@ 28,4 34,12 @@ Describe "sending"
    When run sending "Sending plain text at $DATE" ShellSpec
    The output should equal "Sending plain text at $DATE"
  End
  It 'Can send emoji message from pinephone'
    When run sending "Sending emoji text at 🤔 🤣$DATE" ShellSpec
    The output should equal "Sending emoji text at 🤔 🤣$DATE"
  End
  It 'Can send long message from pinephone'
    When run sending "Sending long text at $DATE $LONGTEXT" ShellSpec
    The output should equal "Sending long text at $DATE $LONGTEXT"
  End
End