aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/numeric_ext_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/numeric_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/numeric_ext_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/numeric_ext_test.rb b/activesupport/test/core_ext/numeric_ext_test.rb
index 8672229fbb..35f90aa776 100644
--- a/activesupport/test/core_ext/numeric_ext_test.rb
+++ b/activesupport/test/core_ext/numeric_ext_test.rb
@@ -145,3 +145,18 @@ class NumericExtSizeTest < Test::Unit::TestCase
assert_equal 3458764513820540928, 3.exabyte
end
end
+
+class NumericExtConversionsTest < Test::Unit::TestCase
+
+ def test_to_utc_offset_s_with_colon
+ assert_equal "-06:00", -21_600.to_utc_offset_s
+ assert_equal "+00:00", 0.to_utc_offset_s
+ assert_equal "+05:00", 18_000.to_utc_offset_s
+ end
+
+ def test_to_utc_offset_s_without_colon
+ assert_equal "-0600", -21_600.to_utc_offset_s(false)
+ assert_equal "+0000", 0.to_utc_offset_s(false)
+ assert_equal "+0500", 18_000.to_utc_offset_s(false)
+ end
+end