[rspec-users] describe, context, feature, scenario
matt at mattwynne.net
Mon Jul 16 09:50:14 UTC 2012
On 16 Jul 2012, at 02:28, Mike Glaz wrote:
> Describe, context, feature, scenario: what is the difference between the
> four and when do I use each one?
Feature and Scenario are Cucumber keywords and AFAIK have nothing to do with RSpec.
#describe and #context are both aliases for the same method which creates a new (anonymous) subclass of RSpec::ExampleGroup. This is essentially the same thing as sublcassing Test::Unit::TestCase as you would in a bog standard test-unit test.
So #describe and #context do the same thing. I tend to use #describe on the top level (what is the thing I'm describing in this spec), then use #context inside that to explain the different hoops I'm making that thing jump through in my examples.
Freelance programmer & coach
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users