Tests are working again

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-07-28 20:42:05 -03:00
parent 91c7ec3bd5
commit 0e08107738
44 changed files with 1640 additions and 1595 deletions

View File

@@ -22,12 +22,16 @@ func FindEventType(name string) (EventType, bool) {
return EventType(-1), false
}
func NewEventType(name string) EventType {
return ciota(name)
}
var (
INSTANCE_VIEWPORT_RESIZE = ciota("instance viewport resize")
INSTANCE_DELETE = ciota("instance delete")
INSTANCE_NEW = ciota("instance new")
INSTANCE_STATS = ciota("instance stats")
INSTANCE_TERMINAL_OUT = ciota("instance terminal out")
SESSION_NEW = ciota("session new")
SESSION_END = ciota("session end")
SESSION_READY = ciota("session ready")
SESSION_BUILDER_OUT = ciota("session builder out")

19
event/mock.go Normal file
View File

@@ -0,0 +1,19 @@
package event
import "github.com/stretchr/testify/mock"
type Mock struct {
M mock.Mock
}
func (m *Mock) Emit(name EventType, sessionId string, args ...interface{}) {
m.M.Called(name, sessionId, args)
}
func (m *Mock) On(name EventType, handler Handler) {
m.M.Called(name, handler)
}
func (m *Mock) OnAny(handler AnyHandler) {
m.M.Called(handler)
}