简体   繁体   中英

Run Rspec block via hot key in VS Code

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.

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM