-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Proposed solution
The following code does not run any examples because with_them is defined a different example group and it does not any where definitions.
describe 'empty' do
where(:x) { [1] }
describe 'another scope' do # !!! NOTE THIS EXTRA CONTEXT!!
with_them do
it 'works' do
end
end
end
end
# 0 examples, 0 failuresRefs https://gitlab.com/gitlab-org/gitlab/-/issues/430870
Proposed solution
Because RSpec::Parameterized support definition of where/with_them in any order it's not straightforward to disallow the mentioned behavior (with_them without any where definitions).
I see the following options:
- Emit a warning whenever
with_themis defined before anywheredefinition. - Disallow definition of
with_thembeforewheredefinition. This is potentially a BREAKING CHANGE.
Related but out of scope
- Disallow or warn about multiple
wheredefinitions. Currently, the latter wins without any warning. - Disallow or warn about multiple
with_themdefinitions. I am unsure about the use-case.
sue445
Metadata
Metadata
Assignees
Labels
No labels