Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify multi-condition filtering #2874

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Commits on Feb 22, 2021

  1. Unify multi-condition metadata 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`:
    
    ```ruby
    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:
    
    ```ruby
    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`:
    
    ```ruby
    RSpec.configure do |c|
      c.include MyModule, :foo => true, :bar => true
    end
    ```
    
    Fixes #1821
    pirj committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    d4515ab View commit details
    Browse the repository at this point in the history