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

Feature Request: Allow CLI tags option to specify a hash #3092

Closed
olbrich opened this issue Jun 22, 2024 · 2 comments
Closed

Feature Request: Allow CLI tags option to specify a hash #3092

olbrich opened this issue Jun 22, 2024 · 2 comments

Comments

@olbrich
Copy link

olbrich commented Jun 22, 2024

Subject of the issue

Assuming I have a spec like...

it "does something useful", tag1: { tag2: true } do
  ...
end

It is currently not possible to include or exclude this style of tag from the CLI.

Your environment

  • Ruby version: 3.3.2
  • rspec-core version: 3.13.0

Expected behavior

I'd like to be able to do something like..

rspec --tag tag1:tag2:true
# or
rspec --tag tag1:{tag2:true}

Actual behavior

RSpec attempts to run specs tagged with tag2:true or {tag2:true} as strings

@pirj
Copy link
Member

pirj commented Jun 22, 2024

Can you give some examples of nested tags in other tools?
This looks interesting. Can you provide some examples from your daily usage, unless it’s super secret?

Somewhat related #1821

@JonRowe
Copy link
Member

JonRowe commented Jun 28, 2024

👋 Although we allow complicated metadata for examples (which is what you've set when thinking of it as tag1) as you've noted the cli isn't capable of filtering on those complicated values, however this isn't something I want to expand here, instead put your tags into the top level.

If this is about being able to pass in the metadata from outside, consider splatting the hash instead e.g.

# instead of
it "does the thing", tag1: my_hash
# do
it "also does the thing, **my_hash

@JonRowe JonRowe closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants