1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Assert that the :prefix option of number_to_human_size is deprecated

This commit is contained in:
Roque Pinel 2015-08-12 21:48:57 -04:00
parent 2a05a72e6a
commit d723bc315e

View file

@ -280,14 +280,16 @@ class NumericExtFormattingTest < ActiveSupport::TestCase
end
def test_to_s__human_size_with_si_prefix
assert_equal '3 Bytes', 3.14159265.to_s(:human_size, :prefix => :si)
assert_equal '123 Bytes', 123.0.to_s(:human_size, :prefix => :si)
assert_equal '123 Bytes', 123.to_s(:human_size, :prefix => :si)
assert_equal '1.23 KB', 1234.to_s(:human_size, :prefix => :si)
assert_equal '12.3 KB', 12345.to_s(:human_size, :prefix => :si)
assert_equal '1.23 MB', 1234567.to_s(:human_size, :prefix => :si)
assert_equal '1.23 GB', 1234567890.to_s(:human_size, :prefix => :si)
assert_equal '1.23 TB', 1234567890123.to_s(:human_size, :prefix => :si)
assert_deprecated do
assert_equal '3 Bytes', 3.14159265.to_s(:human_size, :prefix => :si)
assert_equal '123 Bytes', 123.0.to_s(:human_size, :prefix => :si)
assert_equal '123 Bytes', 123.to_s(:human_size, :prefix => :si)
assert_equal '1.23 KB', 1234.to_s(:human_size, :prefix => :si)
assert_equal '12.3 KB', 12345.to_s(:human_size, :prefix => :si)
assert_equal '1.23 MB', 1234567.to_s(:human_size, :prefix => :si)
assert_equal '1.23 GB', 1234567890.to_s(:human_size, :prefix => :si)
assert_equal '1.23 TB', 1234567890123.to_s(:human_size, :prefix => :si)
end
end
def test_to_s__human_size_with_options_hash