February 9th, 2008
Well, I have to admit I had a few nasty surprises doing this.
Not really due to bluehost in particular but rather due to my own wrong assumptions. It worked on my local machine but outside of that well controlled environment it failed badly.
So exit the idea to run the application from the gem and have multiple configurations in the same directory. I had to revert to one directory per instance (I wanted at least a demo version and an official deckshuffler version) with the configuration done in one place. Which really means I have to give a better look at capristano.
Also I thought I would be able to run based on the installed rails gem rather than freeze it inside my own application. Well, wrong again. Not that it is not possible with enough tweaking of the paths. It simply is not worth the trouble and it seems that freezing the rails version is a fairly standard practice.
So that’s what happens when I think I can do things differently on a projects that gets at most 45 minutes a day. I really hope I learned my lesson !
Posted in Doing | No Comments »
October 16th, 2007
Do you know rspec ? It a behavior driven development tool that defines a domain specific language as well as a mocking library.
I discovered it a month ago (never pretended I was on the bleeding edge of technology, did I ?) and have been using it for all deckshuffler’s unit tests ever since. I clearly plan to migrate all the unit tests to rspec soon. Maybe after I test that other promising tool to perform mutation testing.
But I digress. One of the strong points of rspec: pushing (and enabling) you to mock all the things that are not under test (something I have been advocating for a while but is sort of difficult to do in Java). I won’t rewrite the documentation (on the site which is excellent) that explains all that very well. For rails luke redpath has a good primer and there is no shortage of compliments in blogs (here for instance).
All that to come to saturday’s story. I was trying to test a csv parser which requires to mock the CSV::Reader instance to yield multiple parsed rows. Unfortunately there is nothing in rspec 1.0.8 that enables you to do that. OK, it is a small disappointment. On the other hand this tool is so good I thought, let me contribute something (for once) and put that functionality. So off I go, getting the 1.0.8 and the current release from svn and starting to define a test for a message I would call and_yield_successively.
And then as an afterthought, I checked the trackers on rubyforge and found that it is already done. Second disappointment of the day (tough to get less to do than expected). And on I go downloading the current trunk version of rspec.
The solution is to chain and_yield calls. It is much better than the solution I was about to offer. That’s how good these guys are. A humbling experience.
Posted in Tools | No Comments »