describe, context, feature, scenario: What is the difference(s) among the four and when do I use each one?
describe , context , feature , scenario : What is the difference(s) among the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
contextis an alias fordescribe, so they are functionally equivalent. You can use them interchangeably, the only difference is how your spec file reads. There is no difference in test output for example. The RSpec book says:Personally I like to use
describe, but I can see why people prefercontext.featureandscenarioare a part of Capybara, and not RSpec, and are meant to be used for acceptance tests.featureis equivalent todescribe/context, andscenarioequivalent toit/example.If you’re writing acceptance tests with Capybara, use the
feature/scenariosyntax, if not usedescribe/itsyntax.