Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 622 Bytes

rspec_single_it.md

File metadata and controls

25 lines (14 loc) · 622 Bytes

这个技巧我在写单元测试时常常用到,确保我刚写的before hooks和FactoryBot能用

  1. 指定it的内容

rspec -e test_caserspec --example test_case

  1. 按it所在行

这种方式可以指定运行1个或多个it

如果第10行有一个it,第20行是第二个it

rspec spec/xxx_spec.rb:10:20

Rubymine中的运行设置

rspec_single_it

相关链接

rspec值运行某个test case