0
當斷言失敗或測試中出現錯誤時,我需要在MiniTest中執行一些操作。這個怎麼做。最好的東西,可以在test_helper.rb中如何捕獲MiniTest上的失敗和錯誤事件
我試過一次在全球範圍被寫入MINITEST重試這樣
require 'minitest/retry'
Minitest::Retry.use!(
retry_count: 1,
verbose: true,
io: $stdout,
)
Minitest::Retry.on_failure do |klass, test_name|
puts "One test failed"
end
但是,讓下面的錯誤。
<top (required)>': undefined method
ON_FAILURE」的MINITEST ::重試:模塊(NoMethodError)
看起來像安裝的問題。我重新安裝了寶石,它的工作。 – Codeformer