aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorSebastian Staudt2015-10-07 22:48:42 +0200
committerBaptiste Fontaine2015-12-22 12:46:03 +0100
commitf0a370ea12f5b65faa361bb8f40c45bd1513aede (patch)
tree5f31c72f5583872212aeabcd8df075e1e1eb0aea /Library/Homebrew/test
parent2392574a777c5f97ed76f13cefbe9a497fc8f384 (diff)
downloadbrew-f0a370ea12f5b65faa361bb8f40c45bd1513aede.tar.bz2
Reimplement #pretty_duration
Also reuse this improved implementation in the GitHub rate limit errors. Closes Homebrew/homebrew#44721. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_utils.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/test/test_utils.rb b/Library/Homebrew/test/test_utils.rb
index f533e3f90..d395bbc70 100644
--- a/Library/Homebrew/test/test_utils.rb
+++ b/Library/Homebrew/test/test_utils.rb
@@ -49,11 +49,11 @@ class UtilTests < Homebrew::TestCase
end
def test_pretty_duration
- assert_equal "2 seconds", pretty_duration(1)
+ assert_equal "1 second", pretty_duration(1)
assert_equal "2 seconds", pretty_duration(2.5)
assert_equal "42 seconds", pretty_duration(42)
- assert_equal "4.2 minutes", pretty_duration(252)
- assert_equal "4.2 minutes", pretty_duration(252.45)
+ assert_equal "4 minutes", pretty_duration(240)
+ assert_equal "4 minutes 12 seconds", pretty_duration(252.45)
end
def test_plural