I am currently studying the Ruby programming language. You know; as a software developer you should learn at-least one new language per year! Ruby is a dynamic multi-paradigm programming language that is really fun to use!
This time around I’ve decided to focus on learning a testing framework for Ruby very early. My choice was the very elegant rspec specification framework. RSpec, as most great Ruby libraries, uses an (internal) Domain Specific Language to describe its application domain; which in RSpecs case is describing the expected behaviour of your application.
At the very beginning of my journey I’ve used the Interactive Ruby (irb) REPL (Read-Eval-Print Loop) to explore the language. REPLs are a great way to explore your language of choice! Soon after I’ve started to write tests (or rather specifications) for features of the Ruby language. Personally this didn’t keep me going for very long; it was quite useful.. but.. I needed an actual project to work on!
Of all the goodies Ruby comes with, its Meta Programming features are the most thrilling for me. I wanted to write my own Domain Specific Language (DSL) inside Ruby. And thus was born Teta, a ruby text adventure!
When I am working on Teta I use three Terminal sessions (in TABs). The 1st TAB has got VIM loaded to edit the source code (Derek Wyatt has got tons of great tutorial videos about VIM):
The 2nd TAB is used to issue various commands; including executing all rspec specifications or pushing changes to the git repository. I also use it to access the great ruby documentation (using the ri command):
And finally the 3rd TAB has got an interactive ruby session loaded for exploration and experimentation:
But back to learning new languages using Test Driven Learning. It was initially a blog post by @pragmatrix that pushed me into the direction of using a testing framework when first learning Ruby. To say the least; it was really worth it!
In case you are like me and don’t feel like writing tests for language features; then there are some great people who already did this for you. The Ruby Koans walk you along the path to enlightenment:
If you also want to get started with Ruby then I suggest that you get the following equipment: