From 97607b983725ee6f83fe9d3c81a0fc3062c2e1f5 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Sun, 8 May 2016 16:13:47 +0900 Subject: [PATCH] prevent `ZeroDivisionError` --- CHANGELOG.md | 4 ++++ lib/minitest/test_profile/reporter.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01ffb5b..bcbba08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.1 + +* Prevent raising `ZeroDivisionError` + ## 0.2.0 * Add support for Rails 5 diff --git a/lib/minitest/test_profile/reporter.rb b/lib/minitest/test_profile/reporter.rb index a779f92..e2dd3fa 100644 --- a/lib/minitest/test_profile/reporter.rb +++ b/lib/minitest/test_profile/reporter.rb @@ -43,6 +43,7 @@ def slow_tests_total_time end def ratio + return 0.0 if @calculated_total_time == 0 (slow_tests_total_time / @calculated_total_time) * 100 end