2

I am wondering is there anyway to step through code in 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. Is there anyway to stop the code and step through the way you do in development?

BC00
  • 1,589
  • 3
  • 29
  • 47

3 Answers3

3

Remember to put in the test group in your Gemfile

group :test do
  gem 'byebug'
  . . .
end
John Fadria
  • 1,863
  • 2
  • 25
  • 31
1

Check out minitest-debugger or minitest-byebug.

blowmage
  • 8,854
  • 2
  • 35
  • 40
1

You can use the pry gem and put in a binding.pry in your test case if necessary when running minitest.

Chris Mc
  • 75
  • 7