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
> [email protected]
> 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
end
end
context 'presented with a carrot' do
it 'does nothing' do
end
end
end
end
Always start off (top level) with #describe
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users