Does that title make sense to you? If not, you’re not alone. I dealt with that bit of text for several hours the other day. It’s the beginning of an error message that my pea-sized brain could not parse for the life of me. I received the message while running a simple test involving an assert_select.
Here’s the full thing:
RuntimeError: expected > (got ", cellpadding=\"0\" cellspacing=\"0\"
class=\"entries expenses\" id=\"controls\" summary=\"Spent Efforts\"
style=\"margin-top: 0\">" for <table border="0", cellpadding="0"
cellspacing="0" class="entries expenses" id="controls"
summary="Spent Efforts" style="margin-top: 0">, {"border"=>"0"})
In retrospect, the message does sort of expose the problem, but it’s difficult to see it from the other side of the knowledge-wall. What it boiled down to was invalid HTML. Can you find it? (Bet you can.)
Yep. Somewhere along the line I was translating HTML to a Rails helper and back again and a comma snuck its way into my peripheral vision and then out of site. Looking back at that error message, the string after the word “got” begins with the comma in question and continues on to show the rest of the line of HTML. Maybe in the future I’ll recognize this error message for what it means. Hopefully you will, too.
Related posts:





