rspec/rspec-core

Exclude an array of tag values

Closed this issue · 3 comments

Subject of the issue

Exclude an array of tag values.

Your environment

  • Ruby version: 3.1.6
  • rspec-core version: 3.13.1

Steps to reproduce

rspec --tag ~type:model --tag ~type:system

Expected behavior

Run options: exclude {:type=>["model","system"]}

Actual behavior

Run options: exclude {:type=>"system"}

This is currently the expected behaviour, the filtering is a strict value match and per the docs:

Filtering by tag uses a hash internally, which means that you can’t specify multiple filters for the same key. For instance, if you try to exclude :name => 'foo' and :name => 'bar', you will only end up excluding :name => 'bar'.

So I'm closing this as a duplicate of rspec/rspec#10

I agree that it is the expected behavior according to the docs, it is a feature proposal.
However, it is not a duplicate of rspec/rspec#10, because I was still aiming for a OR between the two values (which I did not make clear).

rspec/rspec#10 covers both AND and OR and the need to disambiguate behavior