Skip to content

Instantly share code, notes, and snippets.

View BetterOnboardingManagerTestsExcerpt.swift
func testPasswordCanNotContainUsername() {
let (didPass, issue) = OnboardingManager.validatePassword(password: "ValidUsername$123",
username: "ValidUsername",
email: "",
phoneNumber: "+11235554321")
XCTAssertEqual(issue, PasswordIssue.containsUsername)
View BadOnboardingManagerTestExcerpt.swift
func test_PasswordCanNotContainUsername() {
let mockPasswordCollectorLauncher = MockPasswordCollectorLauncher()
let mockListener = MockOnboardingManagerListener()
let onboardingManager = BadOnboardingManager(passwordCollectorLauncher: mockPasswordCollectorLauncher)
onboardingManager.listener = mockListener
// TODO: assert the username collector launches now.
onboardingManager.usernameCollectorReturned(username: "ValidUsername")
View BadOnboardingManagerExcerpt.swift
private func validatePassword() {
self.passwordIsValid = false
self.passwordIssue = nil
guard let username = self.username,
let email =,
let phoneNumber = self.phoneNumber,
let password = self.password
else {

Keybase proof

I hereby claim:

  • I am zethraeus on github.
  • I am zethraeus ( on keybase.
  • I have a public key whose fingerprint is 3280 316D DBD3 DB62 6C53 F76D 11B2 8A53 5BB6 93A7

To claim this, I am signing this object:

zethraeus / gist:4583560
Created Jan 21, 2013
Stick it in your .bash_profile on your mac to get QuickLook from the terminal.
View gist:4583560
alias ql='qlmanage -p "$@" > /dev/null'
You can’t perform that action at this time.