I have a separate environment for running Cucumber features, called (unsurprisingly), features. That means I have three useful environments locally: development, test and features. More on this later.

On Friday I got really caught out, trying to run Cucumber against a features environment that was out of date. Now it was my mistake for not looking at the console more clearly, but it shouldn't be a mental overhead to remember to what state each database is in (especially with 3!). So, on the basis that there are only three numbers (0, 1 and n), I generalised the problem with these rake tasks, which I currently have sitting in Merb.root/lib/tasks/database.rake.

And, yes, process_environments is ugly, but it's partly down to making sure the development environment always appears in the list (instead of rake), and partly down to wanting each database migrated exactly once.

I have no idea how this will work with multiple DataMapper repositories, sorry.

Read the rest of this entry

This is the second part of installing a full Merb BDD stack. This time: Ruby, JRuby, Merb, RSpec, Cucumber, Celerity and TextMate bundles (the right way).

Read the rest of this entry

The second installment of this series gives (hopefully full) instructions on how to install all the tools you need to do BDD with Merb. I've recently gone through this on a fairly clean environment (a client's machine that only had MRI Ruby installed), so it should be accurate. If not, please comment any problems, and I'll update the instructions.

Read the rest of this entry

I'm switching to Merb for web development, Rails having tried my patience once too often. I still have a lot of appreciation for Rails, for the push it's given Ruby, and for showing the world that web programming doesn't need several months of learning framework code to build Hello World. But Rails is failing to keep up with demands for faster, cleaner, code, and DHH's attitude does not help matters. (Although, if you are still trying to code on Windows, GET YOUR ACT TOGETHER!) But this is a discussion in its own.

My focus is applying BDD techniques to Merb, using RSpec and Cucumber, with Celerity to drive the full app in development. This series will be my experiences of doing BDD with Merb, so it will be published sporadically, and its content will be fairly random. I already have some content to write up, but in the mean time I'm starting with an easy one I found this morning - as more of an excuse to announce the series.

I should also say that I'm simultaneously working through two Merb projects: one on my own, and one with a client. And a piece of freelance development I'm doing will also have a small embedded web app some time in the (hopefully near) future. So I hope to generate a lot of useful real-world experiences and work out the teething troubles.

UPDATED: you no longer need to do this, the change has been applied to the RSpec TMBundle repo

Read the rest of this entry