         RateLimit.resetAllLimits()
 
         // Now it should get executed
-		let expectation3 = expectationWithDescription("Execute 3")
+		let expectation3 = expectation(description: "Execute 3")
 		let reported5 = RateLimit.execute(name: name1, limit: 1) {
             expectation3.fulfill()
         }
         XCTAssertTrue(reported5)
 
-        let expectation4 = expectationWithDescription("Execute 4")
+        let expectation4 = expectation(description: "Execute 4")
 		let reported6 = RateLimit.execute(name: name2, limit: 1) {
             expectation4.fulfill()
         }
         XCTAssertTrue(reported6)
 
-		waitForExpectationsWithTimeout(1, handler: nil)
+		waitForExpectations(timeout: 1, handler: nil)
     }
 }

//
//  RateLimitTests.swift
//  RateLimitTests

		sleep(1)

        // Now it should get executed
        let expectation2 = expectation(description: "Execute 2")
        reported = RateLimit.execute(name: name, limit: 1) {
            expectation2.fulfill()
        }
        XCTAssertTrue(reported)
        waitForExpectations(timeout: 0, handler: nil)
    }

    func testResetting() {
        let name = "testResetting"

        // It should get excuted first
        let expectation1 = expectation(description: "Execute 1")
        let reported1 = RateLimit.execute(name: name, limit: 1) {
            expectation1.fulfill()
        }
        XCTAssertTrue(reported1)
        waitForExpectations(timeout: 0, handler: nil)

        // Not right away after
        let reported2 = RateLimit.execute(name: name, limit: 1) {
