我正在学习RSpec。我想只在一个文件上运行rspec。我通过以下方式实现了这一点:
cd to/my/project
并且。
rspec ./spec/parent/child/spec.rb
但是在我执行了这个命令之后
rspec --order rand:seed
我的RSpec从第一个测试开始运行。我该如何撤销这个命令?
我正在学习RSpec。我想只在一个文件上运行rspec。我通过以下方式实现了这一点:
cd to/my/project
rspec ./spec/parent/child/spec.rb
但是在我执行了这个命令之后
rspec --order rand:seed
我的RSpec从第一个测试开始运行。我该如何撤销这个命令?
尝试运行单个测试:
rspec ./spec/parent/child/spec.rb:line_number_of_your_test
line_number_of_your_test
可以是跨越测试的任何数字,如果你的 it
块是多行块。
更新:已删除“rand:seed”部分。
您只需要运行
rspec your_file.rb:number_of_line
login.rb
,并且它看起来像1 describe "test something" do
2 it "signup" do
3 ...
4 end
5 it "signin" do
6 ...
7 end
8 end
如果你想运行只有"signin"
测试的话,你需要运行:
rspec login.rb:5
--order rand:seed
吗? - Jagdeep Singhrand:seed
的选项,除非你所说的seed
是指种子数字。 - Jagdeep Singhrand: seed
? - fabdurso