From a3478f1685a507874c710c8461cbfd6be84d95c0 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sat, 5 Nov 2016 16:12:30 +0900 Subject: 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(-) (limited to 'activesupport/test/core_ext/duration_test.rb') diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb index c8e8b8a350..b7b4a9dd00 100644 --- a/activesupport/test/core_ext/duration_test.rb +++ b/activesupport/test/core_ext/duration_test.rb @@ -292,11 +292,11 @@ class DurationTest < ActiveSupport::TestCase 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 ], -- cgit v1.2.3