1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-11 07:14:43 +02:00

Continued e-mail support

This commit is contained in:
Philipp Heckel 2021-12-24 15:01:29 +01:00
parent 6b46eb46e2
commit f553cdb282
10 changed files with 132 additions and 10 deletions

View file

@ -2,10 +2,13 @@ package cmd
import (
"bytes"
"encoding/json"
"github.com/urfave/cli/v2"
"heckel.io/ntfy/client"
"io"
"log"
"os"
"strings"
"testing"
)
@ -24,3 +27,11 @@ func newTestApp() (*cli.App, *bytes.Buffer, *bytes.Buffer, *bytes.Buffer) {
app.ErrWriter = &stderr
return app, &stdin, &stdout, &stderr
}
func toMessage(t *testing.T, s string) *client.Message {
var m *client.Message
if err := json.NewDecoder(strings.NewReader(s)).Decode(&m); err != nil {
t.Fatal(err)
}
return m
}