From c78410286672991cf6df25ef0a9f4529e6b2617b Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sat, 5 Nov 2016 16:12:30 +0900 Subject: [PATCH] Tweaking some test data due to sprintf behavior change in 2.4 2.3: sprintf('%0.1f', 5.55) #=> "5.5" 2.4: sprintf('%0.1f', 5.55) #=> "5.6" see: https://github.com/ruby/ruby/commit/6ed8c79ddb11ccfb580bb0a22b22cc1362250255 and https://github.com/ruby/ruby/commit/295f60b94d5ff6551fab7c55e18d1ffa6a4cf7e3 --- activesupport/test/core_ext/duration_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb index 15aee91..9fea9ab 100644 --- a/activesupport/test/core_ext/duration_test.rb +++ b/activesupport/test/core_ext/duration_test.rb @@ -287,11 +287,11 @@ def test_iso8601_output def test_iso8601_output_precision expectations = [ - [nil, 'P1Y1MT5.55S', 1.year + 1.month + (5.55).seconds ], - [0, 'P1Y1MT6S', 1.year + 1.month + (5.55).seconds ], - [1, 'P1Y1MT5.5S', 1.year + 1.month + (5.55).seconds ], - [2, 'P1Y1MT5.55S', 1.year + 1.month + (5.55).seconds ], - [3, 'P1Y1MT5.550S', 1.year + 1.month + (5.55).seconds ], + [nil, 'P1Y1MT8.55S', 1.year + 1.month + (8.55).seconds ], + [0, 'P1Y1MT9S', 1.year + 1.month + (8.55).seconds ], + [1, 'P1Y1MT8.6S', 1.year + 1.month + (8.55).seconds ], + [2, 'P1Y1MT8.55S', 1.year + 1.month + (8.55).seconds ], + [3, 'P1Y1MT8.550S', 1.year + 1.month + (8.55).seconds ], [nil, 'PT1S', 1.second ], [2, 'PT1.00S', 1.second ], [nil, 'PT1.4S', (1.4).seconds ],