forked from ivahaev/amigo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
amigo_test.go
31 lines (28 loc) · 1 KB
/
amigo_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
package amigo
import (
"testing"
"github.com/franela/goblin"
)
func TestAmigo(t *testing.T) {
g := goblin.Goblin(t)
g.Describe("$New", func() {
g.It("should return pointer to a new Amigo struct with username and password filled and default host and port settings", func() {
a := New("username", "secret")
g.Assert(a.username).Equal("username")
g.Assert(a.secret).Equal("secret")
})
g.It("should return pointer to a new Amigo struct with username and password filled and provided host and default port settings", func() {
a := New("username", "secret", "amigo")
g.Assert(a.username).Equal("username")
g.Assert(a.secret).Equal("secret")
g.Assert(a.host).Equal("amigo")
})
g.It("should return pointer to a new Amigo struct with username, password, host and port filled", func() {
a := New("username", "secret", "amigo", "666")
g.Assert(a.username).Equal("username")
g.Assert(a.secret).Equal("secret")
g.Assert(a.host).Equal("amigo")
g.Assert(a.port).Equal("666")
})
})
}