About Todd Huss

Co-founder of Two Bit Labs, mobile TDD and BDD fanatic.

Using DiffMerge as your Git visual merge and diff tool

Install DiffMerge for Git on Mac OS XOur favorite (and free) visual diff and merge tool for OS X (as well as Linux and Windows) is DiffMerge. It makes resolving nasty Git branch conflicts a snap (relatively speaking). Here’s how to install it and configure it with Git on OS X:

Download the DiffMerge OS X installer. Be sure to download the Installer version. There’s also a DMG version but then you’ll have to manually install the diffmerge command line script.
Continue reading

Empty or incorrect URL with webViewDidStartLoad

If you’re using a UIWebView in your iPhone or iPad app and you want to execute some code when a page starts loading you’ll likely turn to the webViewDidStartLoad: method in UIWebViewDelegate. However, you may have surprisingly unpredictable results. For example, the following code won’t work as expected:

- (void)webViewDidStartLoad:(UIWebView *)webView {
    if ([webView.request.URL hasPrefix:@"http://mywebsite.com"]) {
        // Show buttons specific to my site
    }
}

The issues you’ll run into are:
Continue reading

Adding Unit Tests to an existing iOS project with Xcode 4

When you build a new iPhone or iPad app from scratch, you can generate a new project with tests using Xcode’s project templates, and the test dependency is set up correctly.

However, if you add a unit test target to an existing iOS project, there are some manual steps required to set up the target correctly. Continue reading

Behavior Driven Development what?

Like many, I was fuzzy on BDD or Behavior Driven Development until I started working with BDD tools like Cucumber, JBehave, and Jasmine. However, BDD isn’t a tool. It’s a design approach you can use with your existing testing tools or by adding in additional tools.

BDD refers to one way of doing TDD or Test Driven Development. Specifically it’s outside-in TDD Continue reading