Bookmarker: Learning Rails by Passing Tests
Posted by jeremy.weiland, Thu Mar 08 17:34:00 UTC 2007
At a recent meeting of the CVREG Steering Committee (yes, there is a shadow government!) we tossed around a few ideas on where to steer, ahem, the group. As a group we have some exciting ideas on events, activities, speakers, etc. Key on our agenda is addressing the concerns of group members who are interested in Rails but don’t know have the time to figure out where to start. The best way to spread Ruby is to get people learning Ruby, and in order to do that people have to be motivated to learn.
The problem is somewhat circular: people don’t have time for learning Ruby because of their day job, but their day job doesn’t consider Ruby worth learning because nobody uses it. Until we start getting coders out there motivated to engage in the Ruby community on their own time, Ruby adoption among the technical community will lag. We need to find a way to make starting out in Ruby a more immediately rewarding task, where newbies write the code, hit the button, and see the results. That instant gratification is one of the cool things about Rails, after all – we should be exploiting it!
Tutorials and screencasts are fine, but there’s nothing like the visceral satisfaction of writing code and seeing it work. To that end, Jim had an idea about writing a simple web application, stripping out the application code, and leaving all the tests. The newbie learns Rails by passing the tests in order to build a simple web application. That’s what Bookmarker is, essentially – an empty Rails project with enough tests to make sure that, if the user passes the tests, the user has a bookmarking application.
The idea has grown up somewhat to the point where we’re dividing the project into stages. Each stage deals with new concepts that are realized through implementing application features. A custom rake task checks out a new version of the code, with new tests, whenever the tests have passed. Here’s a rough overview of the stages:
- Stage 1: Scaffolded simple bookmark model
- Stage 2: Add fields and validations to model
- Stage 3: Introduce a User model, acts_as_authenticated
- Stage 4: Split out bookmark model into 2 linked tables, discuss associations
- Stage 5: Implement acts_as_taggable on bookmark model
I’ll try and elaborate on this plan on the project page. In the meantime feel free to register any suggestions you may have or contact me to help. However, please don’t check-in anything without first checking with me. This is a sort of complex task because I’m juggling a lot of different versions of the application in the repository.


I don’t think they can check anything in without an account.
Folks, you have got to check out the project page if you are interested in learning more about Ruby.