August 2009
1 post
Writing Mocha expectations w/ regular expressions
Recently I was rewriting Punchbowl’s Amazon Gift Registry stuff because of this. When writing my functional tests, I wanted to write a test to ensure that I was generating the proper signature to send over to Amazon. So I wrote this expectation: URI.stubs(:parse).once.with(a_string_with_host_and_query_info) This expectation would work sometimes, and fail others. The problem is that in...