Tag Archives: BDD

Creating a Reusable Dictionary of Steps in Cucumber

Corey and I have been using Cucumber to write our integration tests on our current project and I thought I’d share a tip with you that has made our lives so much easier. When making steps in Cucumber, try to make them reusable. The idea behind Cucmber’s integration tests is that you are creating a language to talk about (and test) your project. By creating a dictionary of reusable steps we cut down the amount of time it takes to write new features, and decrease the size of the testing language which makes it easier to wrap your head around it. Here is a sample step definition that could be used to check for various http response codes

Posted in agile development, Cucumber, ruby, rubyonrails | Tagged , , , , , , , , | Leave a comment