mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-18 21:07:44 +03:00
22 lines
421 B
Go
22 lines
421 B
Go
package events
|
|
|
|
import (
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("Event", func() {
|
|
It("marshals Event to JSON", func() {
|
|
testEvent := TestEvent{Test: "some data"}
|
|
data := testEvent.Data(&testEvent)
|
|
Expect(data).To(Equal(`{"Test":"some data"}`))
|
|
name := testEvent.Name(&testEvent)
|
|
Expect(name).To(Equal("testEvent"))
|
|
})
|
|
})
|
|
|
|
type TestEvent struct {
|
|
baseEvent
|
|
Test string
|
|
}
|