Skip to content

Instantly share code, notes, and snippets.

@josephmosby
josephmosby / gist:4227884
Created December 6, 2012 20:09
Week One of Ruby on Rails: RSpec Gripe #1

This will either be the first of a series of posts on "how I became a Ruby convert" or "why Ruby is the worst language on the planet."

I've spent the last two years of my life working with Python and its popular web frameworks (Django, webapp2, and Flask). Python was the first language I ever learned, so I'm admittedly a bit biased toward the "Pythonic" way of doing things. Python favors readability of code, but it also favors exactitude. I can push bits around in memory with the same ease as a GET request. The entire community feels like it's made up of scientists who want to support that - so libraries follow the Pythonic way of doing things. Boolean tests are written the same way in each library as they are in the core Python language.

So you can imagine my frustration when I start working with Ruby on Rails... and specifically, RSpec.

Let's take a look at a webapp2 test:

import unittest