don't return optional from defaultSocket

This commit is contained in:
Erik Little 2017-11-12 10:32:59 -05:00
parent c98df21747
commit 3595662729
No known key found for this signature in database
GPG Key ID: 4930B7C5FBC1A69D
3 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
// MARK Properties // MARK Properties
/// The socket associated with the default namespace ("/"). /// The socket associated with the default namespace ("/").
public var defaultSocket: SocketIOClient? { public var defaultSocket: SocketIOClient {
return socket(forNamespace: "/") return socket(forNamespace: "/")
} }

View File

@ -50,7 +50,7 @@ public protocol SocketManagerSpec : class, SocketEngineClient {
// MARK: Properties // MARK: Properties
/// Returns the socket associated with the default namespace ("/"). /// Returns the socket associated with the default namespace ("/").
var defaultSocket: SocketIOClient? { get } var defaultSocket: SocketIOClient { get }
/// The engine for this manager. /// The engine for this manager.
var engine: SocketEngineSpec? { get set } var engine: SocketEngineSpec? { get set }

View File

@ -106,7 +106,7 @@ class SocketParserTest: XCTestCase {
func validateParseResult(_ message: String) { func validateParseResult(_ message: String) {
let validValues = SocketParserTest.packetTypes[message]! let validValues = SocketParserTest.packetTypes[message]!
let packet = try! testManager.parseString(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.type, SocketPacket.PacketType(rawValue: Int(type) ?? -1)!)
XCTAssertEqual(packet.nsp, validValues.0) XCTAssertEqual(packet.nsp, validValues.0)