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 failures
Refs 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_them
is defined before anywhere
definition. - Disallow definition of
with_them
beforewhere
definition. This is potentially a BREAKING CHANGE.
Related but out of scope
- Disallow or warn about multiple
where
definitions. Currently, the latter wins without any warning. - Disallow or warn about multiple
with_them
definitions. I am unsure about the use-case.
Metadata
Metadata
Assignees
Labels
No labels