Introduction to Outside-in Development with Cucumber

by Charles Max Wood on September 6, 2009

This is a basic introduction to integration testing with cucumber. In it, I describe how to use cucumber and rspec to implement a feature in a web application, emphasizing the importance of writing tests before code, which is often referred to as TDD (test-driven development) or BDD (behavior-driven development, a refinement of the original TDD).
Download 146.8 MB
Download (iphone & ipod) 46.9 MB

  • Anonymous

    This is a very nice step by step intro to Outside-In with Cucumber. I love how you’re showing that Cucumber actually tells you what to do next, and that you’re not taking any shortcuts.

    I usually use create! instead of create in my step definitions and specs. That will make exceptions bubble up if you have validation errors.

    Personally I have started to go very light on the controller and view specs because it is often redundant to and more ceremonial than cucumber features. I mostly use RSpec for ActiveRecord models when I write Rails apps.

    Still, I think it’s good to have a “recommended” workflow – especially for people who are new to working Outside-In/BDD/TDD.

    Thanks Carl!

  • aslakhellesoy

    This is a very nice step by step intro to Outside-In with Cucumber. I love how you're showing that Cucumber actually tells you what to do next, and that you're not taking any shortcuts.

    I usually use create! instead of create in my step definitions and specs. That will make exceptions bubble up if you have validation errors.

    Personally I have started to go very light on the controller and view specs because it is often redundant to and more ceremonial than cucumber features. I mostly use RSpec for ActiveRecord models when I write Rails apps.

    Still, I think it's good to have a “recommended” workflow – especially for people who are new to working Outside-In/BDD/TDD.

    Thanks Carl!

  • http://youngbloods.org Carl Youngblood

    Thanks for the tips Aslak. There is certainly some duplication between the controller specs and cucumber, so I agree that it might be a good idea to dispense with them altogether. Glad to hear from you!

  • http://youngbloods.org Carl Youngblood

    Thanks for the tips Aslak. There is certainly some duplication between the controller specs and cucumber, so I agree that it might be a good idea to dispense with them altogether. Glad to hear from you!

  • Anonymous

    I’ve noticed that my RSpec model tests seem to be very useful but my controller and view tests seem very un-DRY.

  • elitwin

    I've noticed that my RSpec model tests seem to be very useful but my controller and view tests seem very un-DRY.

  • Anonymous

    Great intro to both Cucumber and TDD…nice work Carl!

  • gaveeno

    Great intro to both Cucumber and TDD…nice work Carl!

  • http://twitter.com/agherschon Alexandre Gherschon

    Really helpful, thank you !

  • http://twitter.com/agherschon Alexandre Gherschon

    Really helpful, thank you !

  • surfup

    Maybe its because I’m a total newbie, but I lost your around 10 min line. Could you perhaps a little bit more in your next screencast? You start with Cucumber, then you move onto rspec and lose me there.

    • JK

      Ditto.

  • surfup

    Maybe its because I'm a total newbie, but I lost your around 10 min line. Could you perhaps a little bit more in your next screencast? You start with Cucumber, then you move onto rspec and lose me there.

  • http://twitter.com/dokieboy Mike Williams

    Excellent intoduction to Cucumber, even to a non-rails Ruby newbie

  • http://twitter.com/dokieboy Mike Williams

    Excellent intoduction to Cucumber, even to a non-rails Ruby newbie

  • JK

    Ditto.

  • Pingback: TMTC 38 – BDD and TDD: Integration and Unit Tests — Teach Me To Code

  • Pingback: Delicious Bookmarks for November 18th from 13:53 to 16:07 « Lâmôlabs

  • Andrii

    Now I understand how Cucumber relates to Rspec, thank you.

  • Andrii

    Now I understand how Cucumber relates to Rspec, thank you.

  • Pingback: Cucumber for Rails « Yogeshkannan's Blog

  • Pingback: 005 RC Testing Tools for Rails — Rails Coach

  • Kavin

    Great video carl. Rally usefull

  • Kavin

    Great video carl. Rally usefull

  • Pingback: WebTrickss » Cucumber for Rails

  • Patrik Nygren

    Great introduction to how to do TTD development. I like the fact that you show the process and not only how the stuff works. Really good job!

Previous post:

Next post: