Hi Chris,

On 16 Jul 2009, at 04:14, Chris Sund wrote:
Can someone clarify in "simple" terms the relationship between rspec and cucumber.

Very short answer:

RSpec is for specifying the behaviour of individual pieces of your application, ideally in isolation from all of the other pieces. The mocking framework allows you to write specs for each separate piece (e.g. each class) in a way that doesn't depend on any of the other pieces: "Assuming that pieces A and B and C behave in the way they're supposed to, piece D should behave like this...". This gives you a way to drive the actual implementation of your application in detail, at the level of individual methods doing simple jobs.

Cucumber is for specifying/testing the overall behaviour of your application. Whereas RSpec exercises each individual piece in isolation, Cucumber exercises the interactions between all of the pieces, and allows you to check what happens when several such interactions happen in a particular order (e.g. a user playing a complete game of Codebreaker, or going through the complete checkout/ payment process in a web application). Whereas RSpec examples are very fine-grained and implementation-focused, Cucumber features are meant to be broad and high-level in a way that makes them meaningful to actual users of the application (or the customers who are asking for it to be built) rather than just programmers.

One way of thinking about this is that your specs make all sorts of assumptions about how the rest of the system is meant to behave, and Cucumber is a way of actually checking those assumptions by running the system as a whole.

Cheers,
-Tom
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to