-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_test.go
44 lines (34 loc) · 1.22 KB
/
config_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package play_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/wilhelm-murdoch/go-play"
)
func TestConfigDefaultPost(t *testing.T) {
var (
def = play.ConfigDefault
expected = "https://go.dev/_/share"
)
assert.Equal(t, def.GetPostUrl(), expected, "expected the returned url to be %s, but got %s instead", def.GetPostUrl(), expected)
}
func TestConfigDefaultShare(t *testing.T) {
var (
def = play.ConfigDefault
expected = "https://go.dev/play/p"
)
assert.Equal(t, def.GetShareUrl(), expected, "expected the returned url to be %s, but got %s instead", def.GetShareUrl(), expected)
}
func TestConfigCustomPost(t *testing.T) {
var (
dep = play.NewConfig("https://does-not-work.io", "share", "play")
expected = "https://does-not-work.io/share"
)
assert.Equal(t, dep.GetPostUrl(), expected, "expected the returned url to be %s, but got %s instead", dep.GetPostUrl(), expected)
}
func TestConfigCustomShare(t *testing.T) {
var (
dep = play.NewConfig("https://does-not-work.io", "share", "play")
expected = "https://does-not-work.io/play"
)
assert.Equal(t, dep.GetShareUrl(), expected, "expected the returned url to be %s, but got %s instead", dep.GetShareUrl(), expected)
}