From c3720e219dc5f4b3be6f7692e775212196a0cd0d Mon Sep 17 00:00:00 2001 From: Helge Hess Date: Sat, 9 Jun 2018 10:40:03 +0200 Subject: [PATCH] Add a CONTRIBUTING.md, fix indent ... beautz is in the eye of the beholder. --- CONTRIBUTING.md | 5 +++ Tests/NIORedisTests/RESPValueTests.swift | 13 +++--- Tests/NIORedisTests/XCTestManifests.swift | 6 +-- Tests/RedisTests/RedisClientTests.swift | 49 +++++++++++++---------- Tests/RedisTests/XCTestManifests.swift | 6 +-- 5 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1e54da8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +By submitting a pull request, you represent that you have the right to license +your contribution to the community, and agree by submitting the patch +that your contributions are licensed under the Apache 2.0 license (see +`LICENSE.txt`). + diff --git a/Tests/NIORedisTests/RESPValueTests.swift b/Tests/NIORedisTests/RESPValueTests.swift index 629893e..5675157 100644 --- a/Tests/NIORedisTests/RESPValueTests.swift +++ b/Tests/NIORedisTests/RESPValueTests.swift @@ -2,11 +2,12 @@ import XCTest @testable import NIORedis final class RESPValueTests: XCTestCase { - func testDescription() throws { - XCTAssert(String(describing: RESPValue(1)) == "1") - } + + func testDescription() throws { + XCTAssert(String(describing: RESPValue(1)) == "1") + } - static var allTests = [ - ("testDescription", testDescription) - ] + static var allTests = [ + ("testDescription", testDescription) + ] } diff --git a/Tests/NIORedisTests/XCTestManifests.swift b/Tests/NIORedisTests/XCTestManifests.swift index 01c73f0..3fd8883 100644 --- a/Tests/NIORedisTests/XCTestManifests.swift +++ b/Tests/NIORedisTests/XCTestManifests.swift @@ -2,8 +2,8 @@ import XCTest #if !os(macOS) public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(RESPValueTests.allTests), - ] + return [ + testCase(RESPValueTests.allTests), + ] } #endif diff --git a/Tests/RedisTests/RedisClientTests.swift b/Tests/RedisTests/RedisClientTests.swift index c179109..2f0ffa1 100644 --- a/Tests/RedisTests/RedisClientTests.swift +++ b/Tests/RedisTests/RedisClientTests.swift @@ -1,32 +1,37 @@ import XCTest -@testable import Redis import NIO +@testable import Redis final class RedisClientTests: XCTestCase { - func testCreateClientWithDefaultArguments() throws { - let redisClient = Redis.createClient() + + func testCreateClientWithDefaultArguments() throws { + let redisClient = Redis.createClient() - XCTAssert(redisClient.options.hostname! == "127.0.0.1") - XCTAssert(redisClient.options.port == 6379) - XCTAssert(redisClient.options.password == nil) - XCTAssert(redisClient.options.database == nil) - } + XCTAssert(redisClient.options.hostname! == "127.0.0.1") + XCTAssert(redisClient.options.port == 6379) + XCTAssert(redisClient.options.password == nil) + XCTAssert(redisClient.options.database == nil) + } - func testCreateClientWithSpecifiedArguments() throws { - let eventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 1).next() + func testCreateClientWithSpecifiedArguments() throws { + let eventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 1).next() - let redisClient = Redis.createClient(port: 6380, host: "localhost", password: "password", db: 1, eventLoopGroup: eventLoop) + let redisClient = Redis.createClient(port: 6380, host: "localhost", + password: "password", db: 1, + eventLoopGroup: eventLoop) - XCTAssert(redisClient.options.hostname! == "localhost") - XCTAssert(redisClient.options.port == 6380) - XCTAssert(redisClient.options.password == "password") - XCTAssert(redisClient.options.database == 1) - XCTAssert(redisClient.options.eventLoopGroup === eventLoop) - XCTAssert(redisClient.eventLoop === eventLoop) - } + XCTAssert(redisClient.options.hostname! == "localhost") + XCTAssert(redisClient.options.port == 6380) + XCTAssert(redisClient.options.password == "password") + XCTAssert(redisClient.options.database == 1) + XCTAssert(redisClient.options.eventLoopGroup === eventLoop) + XCTAssert(redisClient.eventLoop === eventLoop) + } - static var allTests = [ - ("testCreateClientWithDefaultArguments", testCreateClientWithDefaultArguments), - ("testCreateClientWithSpecifiedArguments", testCreateClientWithSpecifiedArguments), - ] + static var allTests = [ + ( "testCreateClientWithDefaultArguments", + testCreateClientWithDefaultArguments. ), + ( "testCreateClientWithSpecifiedArguments", + testCreateClientWithSpecifiedArguments ), + ] } diff --git a/Tests/RedisTests/XCTestManifests.swift b/Tests/RedisTests/XCTestManifests.swift index 2d0d08a..5d62969 100644 --- a/Tests/RedisTests/XCTestManifests.swift +++ b/Tests/RedisTests/XCTestManifests.swift @@ -2,8 +2,8 @@ import XCTest #if !os(macOS) public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(RedisClientTests.allTests), - ] + return [ + testCase(RedisClientTests.allTests), + ] } #endif