Moved location of mockSocket
This commit is contained in:
@@ -15,14 +15,6 @@ type socket interface {
|
|||||||
WriteJSON(interface{}) error
|
WriteJSON(interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// mockSocket is a mock implementation of socket
|
|
||||||
// used in the test suite
|
|
||||||
type mockSocket struct{}
|
|
||||||
|
|
||||||
func (s mockSocket) WriteJSON(i interface{}) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// An User Connection
|
// An User Connection
|
||||||
type connection struct {
|
type connection struct {
|
||||||
SocketID string
|
SocketID string
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ package ipe
|
|||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
|
// mockSocket is a mock implementation of socket
|
||||||
|
// used in the test suite
|
||||||
|
type mockSocket struct{}
|
||||||
|
|
||||||
|
func (s mockSocket) WriteJSON(i interface{}) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func TestNewConnection(t *testing.T) {
|
func TestNewConnection(t *testing.T) {
|
||||||
expectedSocketID := "socketID"
|
expectedSocketID := "socketID"
|
||||||
expectedSocket := mockSocket{}
|
expectedSocket := mockSocket{}
|
||||||
|
|||||||
Reference in New Issue
Block a user