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

Justin Ko jko170 at gmail.com
Mon Jul 16 15:18:09 UTC 2012

On Jul 15, 2012, at 7:28 PM, Mike Glaz wrote:

> Describe, context, feature, scenario: what is the difference between the
> four and when do I use each one?
> thanks,
> mike
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

#feature & #scenario come from the "steak" gem or maybe the Capybara RSpec API (if it still exists). They do not exist in RSpec.

I use #context to "setup" different paths/scenarios of what I'm _describing_. Here is an example:

describe Dog do
  describe '#beg' do
    context 'presented with a slice of steak' do
      it 'puts its chin on the floor' do

    context 'presented with a carrot' do
      it 'does nothing' do

Always start off (top level) with #describe

More information about the rspec-users mailing list