Search code examples
rubymine

How do I run specific RSpec examples across multiple files in RubyMine?


I want to run some RSpec examples, across multiple files, using RubyMine. I'm not trying to run all the examples in those files.

Having run rspec bisect, I got an output that looks like this:

The minimal reproduction command is:
  rspec './spec/first_spec.rb[1:1:2,1:1:3]' './spec/second_spec.rb[1:3:18]' --seed 4622

How do I run these specific tests in RubyMine (e.g. to debug them)?


Solution

  • For Rubymine 2022.3.3, I was able to do the following in my RSpec Run/Debug config:

    Mode: Multiple Specs

    Specs: List of spec files delineated with a new line or ||, like

    ./spec/first_spec.rb
    ./spec/second_spec.rb
    

    Example names: List of the actual examples, delineated with ||

    ./spec/first_spec.rb[1:1:2,1:1:3]||./spec/second_spec.rb[1:3:18]
    

    I know this is way late, but I hope this answer will help others who come across this!