Archive for February 2, 2017

Thursday, February 2, 2017

Xcode 8.3: Waiting in XCTest

Joe Masilotti:

At first glance XCTestWaiter is simply a new approach to waiting for XCTestExpectations to fulfill. However, there are a few gems hidden beneath the surface.


A big advantage of this approach is that the test suite reads as a synchronous flow. There is no callback block or completion handler. The helper method simply returns a boolean indicating if the element appeared or not.


You are now completely in control of when and how to fail your tests if an expectation fails to fulfill. This enables waiting for optional elements, like a login screen or a location services authorization dialog.


Along with the new waiter class, XCTestExpectations was subclassed to make specific expectations a little easier to write.

Previously: XCTestExpectation Gotchas, Xcode 6.0.1 Asynchronous Tests, XCTest​Case / XCTest​Expectation / measure​Block().

Finder and Terminal Are Friends

LSelect (via Dr. Drang):

lselect is an AppleScript that lets you select files in the Finder using shell glob syntax as you would to list files with ls. For an animated illustration of how it works, view this short screencast.

Curt Clifton:

As developers, we tend to spend a lot of time typing in Terminal windows. Even so, I often find it more helpful to browse directories and files in Finder. I have three little hacks that simplify moving between the two modes.

Update (2017-02-03): Austin Ziegler notes this script, which can keep a Finder window updated with the current directory in a Terminal window.

Things Every Hacker Once Knew

Eric S. Raymond:

This document is a collection of facts about ASCII and related technologies, notably hardware terminals and RS-232 and modems. This is lore that was at one time near-universal and is no longer. It’s not likely to be directly useful today - until you trip over some piece of still-functioning technology where it’s relevant (like a GPS puck), or it makes sense of some old-fart war story. Even so, it’s good to know anyway, for cultural-literacy reasons.

Emoji Logos

Paul Kafasis:

The new Logoji Instagram account is great. It takes real logos and reworks them to replace elements with standard emoji (using Apple’s emoji art, specifically).