mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-27 09:38:38 +03:00
19 lines
484 B
Go
19 lines
484 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/stretchr/testify/require"
|
|
"heckel.io/ntfy/util"
|
|
"testing"
|
|
)
|
|
|
|
func TestCLI_Publish_Real_Server(t *testing.T) {
|
|
testMessage := util.RandomString(10)
|
|
|
|
app, _, _, _ := newTestApp()
|
|
require.Nil(t, app.Run([]string{"ntfy", "publish", "ntfytest", "ntfy unit test " + testMessage}))
|
|
|
|
app2, _, stdout, _ := newTestApp()
|
|
require.Nil(t, app2.Run([]string{"ntfy", "subscribe", "--poll", "ntfytest"}))
|
|
require.Contains(t, stdout.String(), testMessage)
|
|
}
|