I actually struggled with this exact question, but couldn't think of a good solution in terms of how I would write the test.  I'll have a go at it with a bool to determine whether we expect a nil or not, and see where I get.