don't return optional from defaultSocket
This commit is contained in:
parent
c98df21747
commit
3595662729
@ -49,7 +49,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
|
||||
// MARK Properties
|
||||
|
||||
/// The socket associated with the default namespace ("/").
|
||||
public var defaultSocket: SocketIOClient? {
|
||||
public var defaultSocket: SocketIOClient {
|
||||
return socket(forNamespace: "/")
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ public protocol SocketManagerSpec : class, SocketEngineClient {
|
||||
// MARK: Properties
|
||||
|
||||
/// Returns the socket associated with the default namespace ("/").
|
||||
var defaultSocket: SocketIOClient? { get }
|
||||
var defaultSocket: SocketIOClient { get }
|
||||
|
||||
/// The engine for this manager.
|
||||
var engine: SocketEngineSpec? { get set }
|
||||
|
||||
@ -106,7 +106,7 @@ class SocketParserTest: XCTestCase {
|
||||
func validateParseResult(_ message: String) {
|
||||
let validValues = SocketParserTest.packetTypes[message]!
|
||||
let packet = try! testManager.parseString(message)
|
||||
let type = String(message.characters.prefix(1))
|
||||
let type = String(message.prefix(1))
|
||||
|
||||
XCTAssertEqual(packet.type, SocketPacket.PacketType(rawValue: Int(type) ?? -1)!)
|
||||
XCTAssertEqual(packet.nsp, validValues.0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user