aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-01-01 01:03:16 +0900
committerGitHub <noreply@github.com>2018-01-01 01:03:16 +0900
commit540c60ff4723670bf106c2ae46e3a6723cbf42a4 (patch)
tree48c1621337d848201054f1b5d647d9fe76f1e43e /activesupport/test
parent316d87e412e1c6bc9c7a590b866befbb6bab167f (diff)
parent041b2052e6d5d715474e34f3625f88f586941bfd (diff)
downloadrails-540c60ff4723670bf106c2ae46e3a6723cbf42a4.tar.gz
rails-540c60ff4723670bf106c2ae46e3a6723cbf42a4.tar.bz2
rails-540c60ff4723670bf106c2ae46e3a6723cbf42a4.zip
Merge pull request #31310 from kinnrot/duration-modulo
Duration created with no parts will have a default seconds part eqaul to 0
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/duration_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb
index dbee543644..4a02f27def 100644
--- a/activesupport/test/core_ext/duration_test.rb
+++ b/activesupport/test/core_ext/duration_test.rb
@@ -71,6 +71,8 @@ class DurationTest < ActiveSupport::TestCase
assert_equal "7 days", 7.days.inspect
assert_equal "1 week", 1.week.inspect
assert_equal "2 weeks", 1.fortnight.inspect
+ assert_equal "0 seconds", (10 % 5.seconds).inspect
+ assert_equal "10 minutes", (10.minutes + 0.seconds).inspect
end
def test_inspect_locale