0

Is there a way to configure VS Code to run an Rspec block in the current cursor position?

Either a describe or it block.

I found similar functionality through Atom with the Rspec extension. A hot key became available Cmd + alt + X. Which would trigger the single it or a group within describe depending where the cursor was.

Lex
  • 4,749
  • 3
  • 45
  • 66

2 Answers2

4

You can install this extension https://marketplace.visualstudio.com/items?itemName=noku.rails-run-spec-vscode

And then press Cmd + L to run the specific describe or it

macav
  • 1,472
  • 1
  • 9
  • 10
0

I installed Rails Test Runner. Open your spec file, put your cursor on/in the describe or it block, then right click. You see 2 choices:

  1. Run all tests in file
  2. Run tests starting from the current line

To set up RSpec to run in VS Code, with breakpoints, see my answer.

Raymond Gan
  • 4,612
  • 3
  • 24
  • 19