perl-Test-Spec icon indicating copy to clipboard operation
perl-Test-Spec copied to clipboard

fdescribe/fit functionality ?

Open gempesaw opened this issue 9 years ago • 2 comments

Hi! Thanks for Test::Spec, I quite enjoy using it. Is there existing functionality available like Jasmine's focused specs? I find myself wanting to only run one describe spec or one it spec, but the only thing I've found in Test::Spec is xdescribe/xit, which means I'd have to add x to every other spec instead of adding f to the single spec I'm focused on.

If the functionality isn't available, would you be amenable to a PR for it?

edit: ah right, I forgot about providing an argument to runtests and/or setting $ENV{SPEC}. Hm, that should help...

gempesaw avatar Feb 01 '16 21:02 gempesaw

Thanks for the feedback and the link, haven't seen that before. Personally I think runtests($test_name_to_run) is a more general version that covers this use case. What do you think?

andyjones avatar Feb 08 '16 09:02 andyjones

RSpec has the focus option: https://relishapp.com/rspec/rspec-core/v/2-6/docs/filtering/inclusion-filters

The downside of runtests($test_name_to_run) and that we need to convert the test name to underscore and add to that list.

The focus option was used by me in RSpec and for people that I know that use RSpec today.

celsodantas avatar Nov 16 '18 10:11 celsodantas