Skip to content

Commit 62a373e

Browse files
committed
Remove redunant 'public' keywords from Tests
1 parent 496ce1f commit 62a373e

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

Tests/Extensions/String+Extensions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import XCTest
22

33
extension String {
44

5-
public func removing(_ set: CharacterSet) -> String {
5+
func removing(_ set: CharacterSet) -> String {
66
var newString = self
77
newString.removeAll { char -> Bool in
88
guard let scalar = char.unicodeScalars.first else { return false }
@@ -11,11 +11,11 @@ extension String {
1111
return newString
1212
}
1313

14-
public var escaped: String {
14+
var escaped: String {
1515
return self.debugDescription
1616
}
1717

18-
public func toJsonData(validate: Bool = true, file: StaticString = #file, line: UInt = #line) -> Data {
18+
func toJsonData(validate: Bool = true, file: StaticString = #file, line: UInt = #line) -> Data {
1919
do {
2020
let data = try self.toData()
2121
if validate {
@@ -29,7 +29,7 @@ extension String {
2929
return Data()
3030
}
3131

32-
public func toJsonDict(file: StaticString = #file, line: UInt = #line) -> [String: Any] {
32+
func toJsonDict(file: StaticString = #file, line: UInt = #line) -> [String: Any] {
3333
do {
3434
let json = try toJsonAny()
3535

Tests/Extensions/XCTest+Assertions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ private func executeAndAssignEquatableResult<T>(_ expression: @autoclosure () th
88
to = try expression()
99
}
1010

11-
public func XCTAssertNotNil<T>(_ expression: @autoclosure () throws -> T?, _ message: String = "", file: StaticString = #file, line: UInt = #line, also validateResult: (T) -> Void) {
11+
func XCTAssertNotNil<T>(_ expression: @autoclosure () throws -> T?, _ message: String = "", file: StaticString = #file, line: UInt = #line, also validateResult: (T) -> Void) {
1212

1313
var result: T?
1414

Tests/Helpers/Mocks.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ open class MockWebSocket: NWWebSocket {
217217
}
218218
}
219219

220-
public func stringContainsElements(_ str: String, elements: [String]) -> Bool {
220+
func stringContainsElements(_ str: String, elements: [String]) -> Bool {
221221
var allElementsPresent = true
222222
for element in elements {
223223
if str.range(of: element) == nil {
@@ -279,27 +279,27 @@ open class StubberForMocks {
279279
}
280280

281281
open class FunctionCall {
282-
public let name: String
283-
public let args: [Any]?
282+
let name: String
283+
let args: [Any]?
284284

285285
init(name: String, args: [Any]?) {
286286
self.name = name
287287
self.args = args
288288
}
289289
}
290290

291-
public typealias Response = (data: Data?, urlResponse: URLResponse?, error: NSError?)
291+
typealias Response = (data: Data?, urlResponse: URLResponse?, error: NSError?)
292292

293-
public class MockSession: URLSession {
294-
public static var mockResponses: [String: Response] = [:]
293+
class MockSession: URLSession {
294+
static var mockResponses: [String: Response] = [:]
295295
// swiftlint:disable:next large_tuple
296-
public static var mockResponse: (data: Data?, urlResponse: URLResponse?, error: NSError?) = (data: nil, urlResponse: nil, error: nil)
296+
static var mockResponse: (data: Data?, urlResponse: URLResponse?, error: NSError?) = (data: nil, urlResponse: nil, error: nil)
297297

298-
override public class var shared: URLSession {
298+
override class var shared: URLSession {
299299
return MockSession()
300300
}
301301

302-
override public func dataTask(with: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask {
302+
override func dataTask(with: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask {
303303
var response: Response
304304
let mockedMethodAndUrlString = "\(with.httpMethod!)||\((with.url?.absoluteString)!)"
305305

@@ -311,22 +311,22 @@ public class MockSession: URLSession {
311311
return MockTask(response: response, completionHandler: completionHandler)
312312
}
313313

314-
public class func addMockResponse(for url: URL, httpMethod: String, data: Data?, urlResponse: URLResponse?, error: NSError?) {
314+
class func addMockResponse(for url: URL, httpMethod: String, data: Data?, urlResponse: URLResponse?, error: NSError?) {
315315
let response = (data: data, urlResponse: urlResponse, error: error)
316316
let mockedResponseString = "\(httpMethod)||\(url.absoluteString)"
317317
mockResponses[mockedResponseString] = response
318318
}
319319

320-
public class MockTask: URLSessionDataTask {
321-
public var mockResponse: Response
322-
public let completionHandler: ((Data?, URLResponse?, NSError?) -> Void)?
320+
class MockTask: URLSessionDataTask {
321+
var mockResponse: Response
322+
let completionHandler: ((Data?, URLResponse?, NSError?) -> Void)?
323323

324-
public init(response: Response, completionHandler: ((Data?, URLResponse?, NSError?) -> Void)?) {
324+
init(response: Response, completionHandler: ((Data?, URLResponse?, NSError?) -> Void)?) {
325325
self.mockResponse = response
326326
self.completionHandler = completionHandler
327327
}
328328

329-
override public func resume() {
329+
override func resume() {
330330
DispatchQueue.global(qos: .default).async {
331331
self.completionHandler!(self.mockResponse.data, self.mockResponse.urlResponse, self.mockResponse.error)
332332
}

Tests/Unit/Models/PrivateEncryptedChannelTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ class PrivateEncryptedChannelTests: XCTestCase {
347347

348348
private class TestAuthorizer: Authorizer {
349349
var authResponseSequence: [PusherAuth]
350-
public init(_ authResponseSequence: [PusherAuth]) {
350+
init(_ authResponseSequence: [PusherAuth]) {
351351
self.authResponseSequence = authResponseSequence
352352
}
353353
func fetchAuthValue(socketID: String, channelName: String, completionHandler: @escaping (PusherAuth?) -> Void) {

Tests/Unit/Protocols/PusherConnectionDelegateTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import XCTest
44

55
class PusherConnectionDelegateTests: XCTestCase {
66
private class DummyDelegate: PusherDelegate {
7-
public let stubber = StubberForMocks()
7+
let stubber = StubberForMocks()
88
open var socket: MockWebSocket?
99
open var ex: XCTestExpectation?
1010
var testingChannelName: String?

0 commit comments

Comments
 (0)