简体   繁体   English

在minitest中逐步执行代码

[英]Step through code in minitest

I am wondering is there anyway to step through code in minitest? 我想知道是否有必要在minitest中逐步执行代码? if I put byebug or debugger in my code and run the test that hits it, the tests run right through and dont stop. 如果我在代码中放入了byebug或调试器,并运行了命中它的测试,则测试将一直运行并且不会停止。 Is there anyway to stop the code and step through the way you do in development? 无论如何,有没有停止代码并逐步完成开发工作的方式?

Remember to put in the test group in your Gemfile 切记将测试组放入Gemfile中

group :test do
  gem 'byebug'
  . . .
end

运行minitest时,如有必要,可以使用pry宝石并在测试用例中放入binding.pry。

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

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