bitfission

will leinweber

rspec 1.1 and my open source debut

Posted by Will Leinweber Mon, 17 Dec 2007 21:36:00 GMT

Everyone’s favorite BDD framework, rspec, has recently come out with a lot of nice improvements and fixes. One big thing that’s in there now is the ability to write stories. The best thing, however, is that I’m now on the community page!

Over the summer, while I was working at Collaborative Drug Discovery, Dav Yaginuma from Pivotal Labs and I wrote a patch to allow the specparser to parse describe blocks that had :behaviourtype set on them. This let us run focused tests on those sections. After figuring out what was wrong, it was just a matter of fixing some regexes and adding another clause.

Then when I was at the rails edge conference in Chicago in August, I had a chance to meet David Chelimsky. He suggested that I submit that as a patch. I first checked with CDD to see if doing so was breaking any sort of agreement I signed or anything, then wrote some specs for the changes and submitted. Even though it wasn’t all that much and it was pair-programmed, it was my first open source contribution and seeing it “official” now is awesome.

1 comment |

script/console sandbox mode

Posted by Will Leinweber Thu, 06 Dec 2007 16:45:00 GMT
I was exploring my redmine install on my server by going into script/console. Whenever I tried to do anything, like finding a user, I’d get
NameError: undefined local variable or method `acts_as_watchable' for Issue:Class 
followed by a stack trace. I spent a while trying to figure out why this wasn’t working, then gave up. A few weeks later I tried again, and quickly realized the problem was that I only have a production environment set up, and I wasn’t telling script/console to use the production environment. In the process of figuring out how to do that ( –help ), I ran into this awesome feature I simply never knew about.
  -s, --sandbox      Rollback database modifications on exit. 
This is really cool. Especially if you’re going to be mucking around with your production data. I’m planning on hacking script/console to have -s enable by default if you go into the production environment. Or at the very least an alias.

1 comment |