Archive for the ‘Uncategorized’ Category
I’ve moved to San Francisco
I moved here 2 weeks ago, on the 1st of November, to work for the awesome Pivotal Labs and it’s been a really good start.
I’ve found a nice apartment in SOMA with a really cool roommate. The apartment even has a view of sorts of the Bay Bridge and is about a 20 minute walk to work. This means I’m easily getting my 10000 steps a day.
My first week at Pivotal was spent in the Tracker team, the electronic backbone of Pivotal’s XP flavored methodology (you can also use Tracker for free).
The team has been really great - they’re all really strong developers, quietly confident but balanced, focused and pragmatic. This seems to consistent with everyone I’ve met at Pivotal. Everyone has been very warm and welcoming, and they all seem like well adjusted individuals - a good sign.
Good times.
Testing instance methods in a Module with Object.extend()
A common type of mixin I’ve encountered involves a Module with instance methods which is included into a Class.
Writing an orthogonal test for a target Class is easy enough, you simply mock/stub any methods the Module provides.
Testing the Module elegantly however is less obvious, atleast it wasn’t obvious to me.
One approach I’ve used is to create a fake class for the test, include the Module and finally instantiate this for the test. But there’s the issue of testing the Module’s interaction with the including Class. For this you could partially mock/stub the test class instance, but there’s a simpler approach that avoids the test class altogether: create an ordinary rSpec mock instance and extend it with the Module.
Use before reuse
Please.
So long comment spam
Since I created this blog in 2003 I’ve faced an ongoing deluge of comment spam. I tried to address this by manually approving each post, but this turned out to be time-consuming and led to an annoying lag between the comment being posted and appearing on the site.
I then tried to automate this process using various spam filters including Akismet but they turned out to be useless with too many false positives.
I’ve finally fallen back on a “prove-you’re-a-person” image which seems to be working well so far. I’ve had no comment spam since installing it, though I’m unsure if I’ve missed any genuine comments. So, help me out - post a comment in response to this entry so I know I’m not missing any and let me know if you’ve got a better idea for dealing with comment spam.