forked from SierraSoftworks/sentry-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_test.go
More file actions
40 lines (34 loc) · 850 Bytes
/
release_test.go
File metadata and controls
40 lines (34 loc) · 850 Bytes
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
package sentry
import (
"encoding/json"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func ExampleRelease() {
cl := NewClient(
// You can set the release when you create a client
Release("v1.0.0"),
)
cl.Capture(
// You can also set it when you send an event
Release("v1.0.0-dev"),
)
}
func TestRelease(t *testing.T) {
Convey("Release", t, func() {
Convey("Release()", func() {
Convey("Should use the correct Class()", func() {
So(Release("test").Class(), ShouldEqual, "release")
})
Convey("MarshalJSON", func() {
Convey("Should marshal to a string", func() {
Convey("Should marshal to a string", func() {
b, err := json.Marshal(Release("test"))
So(err, ShouldBeNil)
So(string(b), ShouldEqual, `"test"`)
})
})
})
})
})
}