Allow describe
without requiring an argument
#10974
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
describe
method of the spec DSL currently requires an argument for thedescription
. The general idea behind that is probably, that it makes no sense to describe something without a description.With spec's focus feature I've several times found myself in a situation where I want to run a couple of related examples in a spec file. Adding
focus: true
on each one is cumbersome, so I created a (temporary) example group withdescribe
and addedfocus: true
to that. Butdescribe
requires an argument with a description. For this focus-only example group I don't need a description, so could just be empty.I'm proposing to add a default value to the
description
argument, to make this use case a bit friendlier. Now I'm no longer forced to pass in an empty description.context
is functionally identical todescribe
, so it also gets a default argument.