exclusion/inclusion list

15 views
Skip to first unread message

Joao Miguel Ferreira

unread,
Jan 7, 2021, 2:40:50 PM1/7/21
to rspec
Hello,

Is it possibe to tell rspec to exclude a few files or a whole directory ?

spec/dirA/features_a_spec.rb
spec/dirB/features_b_spec.rb
spec/too_dangerous_dont_even_try/x_rspec.rb

rspec would not go into the "too_dangerous" directory.

in an ideal scenario the paths to be excluded would be listed on a text file somewhere

Thank you
João

Phil Pirozhkov

unread,
Jan 7, 2021, 3:04:31 PM1/7/21
to Joao Miguel Ferreira
Hi João

Yes, set metadata on those files with ‎https://www.rubydoc.info/github/rspec/rspec-core/RSpec%2FCore%2FConfiguration:define_derived_metadata and exclude them using that tag with this option https://relishapp.com/rspec/rspec-core/v/3-10/docs/command-line/tag-option and put it to your .rspec file.

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/4e48c09f-fae8-4863-a8d6-cb9ed5ce3cban%40googlegroups.com.

Joao Miguel Ferreira

unread,
Jan 7, 2021, 3:45:22 PM1/7/21
to rs...@googlegroups.com
Hi Phil,

Yes, I simply added the following line to the .rspec file and it works just fine

--exclude-pattern "spec/excluded/*"

Thank you
Joao


Reply all
Reply to author
Forward
0 new messages