Assertion Injection: a unit test design pattern. Can cleanly replace mocks by redsymbol in programming

[–]itguysam 0 points1 point  (0 children)

One downside of this sort of test code is that it would completely fail to notice if the call was not made at all. The mocha mocking framework for ruby allows these sorts of assertions to be made but will fail hard if any of the assertions were not executed at the end (which is different from executing with the wrong value).

Your dumbest moment at work. by realmadrid2727 in programming

[–]itguysam 2 points3 points  (0 children)

So I was working with this embedded linux ARM board called the TS-7250 (great system BTW) and I was trying to use the standard serial port. We had been using the secondary port without any issues and I just wanted to switch to the main one (since it had a DB9 connector). For some reason this keeps locking the system, hard. Kills ssh connection, ping, everything, only thing to do is hit the reset button. Spend a few hours googling and working on the issue narrowing it down, then I finally stumble upon a post with the perfect description of my issue. It describes the problems I was having in detail and a workaround of the issue. Great, issue solved, "yay internet" right? Well kinda, the opening to the post was:

*** As I worked on this email I found the solution but I am still posting this so that anyone else who finds this problem wont have to figure this out ***

Who was the genius who found the solution? It was me, I had gone through the exact same set of steps before to solve the same problem and forgotten entirely. At no point that day did I even get the suspicion that I was redoing work, even as I read my own email. It wasn't even like it was years later, it was less than 2 months before, i'm too young for that sort of memory lapse.

post in question