The perils in trusting syntax highlighting
14 Feb 2008Today after upgrading RSpec I ran a user story that I had just written and received a wonderful error: You have a nil object when you didn't expect it! (NoMethodError). The error occurred while evaluating nil.add_scenario
. I didn’t even think to check my user story because the syntax highlighting looked fine and it made sense to me:
Of course, if I actually bothered to read it properly then I would have seen that the first line should have read:
Moral of the story: even if the code that you have to write is small, always assume that you are capable of making silly mistakes!