[英]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?有没有办法配置 VS Code 在当前光标位置运行 Rspec 块?
Either a describe
or it
block. describe
或it
阻止。
I found similar functionality through Atom with the Rspec extension.我通过带有 Rspec 扩展的 Atom 发现了类似的功能。 A hot key became available
Cmd + alt + X
.一个热键可用
Cmd + alt + X
。 Which would trigger the single it
or a group within describe
depending where the cursor was.这将触发单个
it
或describe
的组,具体取决于光标所在的位置。
You can install this extension https://marketplace.visualstudio.com/items?itemName=noku.rails-run-spec-vscode你可以安装这个扩展https://marketplace.visualstudio.com/items?itemName=noku.rails-run-spec-vscode
And then press Cmd + L
to run the specific describe
or it
然后按
Cmd + L
运行特定的describe
或it
I installed Rails Test Runner .我安装了Rails Test Runner 。 Open your spec file, put your cursor on/in the
describe
or it
block, then right click.打开您的规范文件,将光标放在
describe
或it
块上/中,然后右键单击。 You see 2 choices:您会看到 2 个选择:
To set up RSpec to run in VS Code, with breakpoints, see my answer .要将 RSpec 设置为在 VS Code 中运行,并带有断点,请参阅我的回答。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.