rails/activesupport/test/core_ext
Andrew White 28938dd64c Fix implicit calculations with scalars and durations
Previously calculations where the scalar is first would be converted
to a duration of seconds but this causes issues with dates being
converted to times, e.g:

    Time.zone = "Beijing"           # => Asia/Shanghai
    date = Date.civil(2017, 5, 20)  # => Mon, 20 May 2017
    2 * 1.day                       # => 172800 seconds
    date + 2 * 1.day                # => Mon, 22 May 2017 00:00:00 CST +08:00

Now the `ActiveSupport::Duration::Scalar` calculation methods will try
to maintain the part structure of the duration where possible, e.g:

    Time.zone = "Beijing"           # => Asia/Shanghai
    date = Date.civil(2017, 5, 20)  # => Mon, 20 May 2017
    2 * 1.day                       # => 2 days
    date + 2 * 1.day                # => Mon, 22 May 2017

Fixes #29160, #28970.
2017-05-20 16:36:25 +01:00
..
array Revert "Merge pull request #25811 from oss92/to_sentence_fallback_string" 2016-11-14 13:16:00 -05:00
class modernizes hash syntax in activesupport 2016-08-06 19:38:33 +02:00
digest applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
hash Add three new rubocop rules 2016-08-16 04:30:11 -03:00
kernel applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
module Correct spelling 2017-02-05 19:00:18 -06:00
object Fix duplicable? for Ratiional and Complex on ruby master, since they are now duplicable 2017-03-23 17:34:30 +05:30
bigdecimal_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
class_test.rb Exclude singleton classes from subclasses and descendants 2016-12-01 14:53:31 -05:00
date_and_time_behavior.rb Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
date_and_time_compatibility_test.rb Handle #to_time and memoization taking into account memoization, frozen state, and preserve_timezone flag. 2017-03-06 18:08:31 -05:00
date_ext_test.rb Add tests for blank? 2017-02-06 23:27:50 +09:00
date_time_ext_test.rb Add additional options to time change methods 2017-04-14 18:04:13 +01:00
duration_test.rb Fix implicit calculations with scalars and durations 2017-05-20 16:36:25 +01:00
enumerable_test.rb Remove checks for Enumerator#size method 2017-04-25 07:40:51 -07:00
file_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
hash_ext_test.rb Move HashWithIndifferentAccess tests to separate file 2017-03-30 00:05:40 -05:00
integer_ext_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
kernel_test.rb Unused class for testing since 93559da4826546d07014f8cfa399b64b4a143127 2017-01-18 17:30:46 +09:00
load_error_test.rb Remove deprecated constant MissingSourceFIle 2016-11-14 11:25:52 +00:00
marshal_test.rb add optional second argument to ActiveSupport core extension for Marshal#load so it can take a proc 2017-02-24 12:12:07 -05:00
module_test.rb Update test names to match method name 2017-05-04 16:30:03 -04:00
name_error_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
numeric_ext_test.rb Allocation free Integer#to_s 2017-01-19 15:24:41 +01:00
range_ext_test.rb Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
regexp_ext_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
secure_random_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
string_ext_test.rb Merge pull request #28480 from mubashirhanif/add_keep_id_suffix_option_to_humanize_new 2017-03-28 17:57:17 -04:00
time_ext_test.rb Add additional options to time change methods 2017-04-14 18:04:13 +01:00
time_with_zone_test.rb Add additional options to time change methods 2017-04-14 18:04:13 +01:00
uri_ext_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00