[rspec-users] describe, context, feature, scenario

Avdi Grimm groups at inbox.avdi.org
Mon Jul 16 15:39:38 UTC 2012


Feature and scenario are aliases defined by capybara.
On Jul 16, 2012 5:50 AM, "Matt Wynne" <matt at mattwynne.net> wrote:

>
> 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.
>
> cheers,
> Matt
>
> --
> Freelance programmer & coach
> Author, http://pragprog.com/book/hwcuc/the-cucumber-book
> Founder, http://www.relishapp.com/
> Twitter, https://twitter.com/mattwynne
>
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120716/a171da58/attachment.html>


More information about the rspec-users mailing list