简体   繁体   English

Rubymine-代码折叠所有rspec示例

[英]Rubymine - code folding ALL rspec examples

Does anyone know if it's possible to code fold all rspec examples either automatically on opening a spec file or preferably by key binding from within Rubymine. 有谁知道是否有可能在打开spec文件时自动折叠所有rspec示例,或者最好通过Rubymine中的键绑定来折叠所有rspec示例。

For a spec with lots of examples it would be very handy to just collapse all examples to get an overview of the complete spec for a model, controller, etc. This would make it far easier to review and check for any missing edge conditions for example. 对于具有大量示例的规范,只需折叠所有示例以获取模型,控制器等的完整规范的概述将非常方便。例如,这将使检查和检查任何缺失的边缘条件变得更加容易。

What I would like is for the it block to code fold so that they result in something like... 我想要的是it块进行代码折叠,以便产生类似...的结果。

it 'should test something' do ... end

... without having to manually code fold every individual example. ...无需手动编写折叠每个示例的代码。

Try going under Code > Folding > Expand All to Level > 3⌥⌘* in the menus. 尝试进入菜单中的“代码”>“折叠”>“全部展开到级别”>“ 3 *”。 That should fold/expand to what you want. 那应该折叠/扩展到您想要的。

Code folding menu in RubyMine RubyMine中的代码折叠菜单

More here: https://www.jetbrains.com/help/ruby/2016.2/code-folding.html#folding_menu 此处更多内容: https : //www.jetbrains.com/help/ruby/2016.2/code-folding.html#folding_menu

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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