Skip to content

Unify multi-condition filtering

gitlab-qa-bot requested to merge unify-multi-condition-filtering-2 into 4-0-dev

Created by: pirj

Always use all? semantic when applying metadata conditions for filtering. Previously all? was only used for hooks, and any? was used for everything else (module inclusions, shared example group inclusion, define derived metadata).

Before this change MyModule would be included to example groups defining any of foo: true or bar: true:

RSpec.configure do |c|
  c.include MyModule, :foo => true, :bar => true
end

After the change the same any? behaviour is achievable splitting into two statements:

RSpec.configure do |c|
  c.include MyModule, :foo => true
  c.include MyModule, :bar => true
end

MyModule will only be included in groups with both :foo => true AND :bar => true

RSpec.configure do |c|
  c.include MyModule, :foo => true, :bar => true
end

Fixes #1821 (closed)

Depends on:

Merge request reports