1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/test
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
..
autoloading_fixtures Correct spelling 2017-02-05 19:00:18 -06:00
core_ext Fix implicit calculations with scalars and durations 2017-05-20 16:36:25 +01:00
dependencies normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
deprecation modernizes hash syntax in activesupport 2016-08-06 19:38:33 +02:00
file_fixtures introduce ActiveSupport::Testing::FileFixtures. 2015-01-28 12:29:34 +01:00
fixtures normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
json Add missing requires 2017-02-22 13:25:44 +00:00
notifications Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
testing Should escape meta characters in regexp 2017-05-07 04:10:00 +09:00
xml_mini Fixes Hash.from_xml with frozen strings for all backends 2017-04-20 16:31:50 -04:00
abstract_unit.rb Don't pollute Object with rubinius_skip and jruby_skip 2017-01-17 18:51:50 +09:00
array_inquirer_test.rb It would be safer not to totally undef core classes' respond_to_missing? 2017-01-15 04:42:03 +09:00
autoload_test.rb improve error message when include assertions fail 2016-09-16 12:03:37 -07:00
benchmarkable_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
broadcast_logger_test.rb Merge pull request #26874 from tgxworld/fix_broadcast_logger 2016-11-25 15:57:50 +10:30
caching_test.rb Use recyclable cache keys (#29092) 2017-05-18 18:12:32 +02:00
callback_inheritance_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
callbacks_test.rb Remove deprecated behavior that halts callbacks when the return is false 2017-02-07 12:19:37 -03:00
class_cache_test.rb "Use assert_nil if expecting nil. This will fail in minitest 6." 2016-12-25 02:29:52 +09:00
clean_backtrace_test.rb applies remaining conventions across the project 2016-08-06 20:20:22 +02:00
clean_logger_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
concern_test.rb use public Module#include instead of send :include 2016-11-27 22:20:52 +09:00
configurable_test.rb improve error message when include assertions fail 2016-09-16 12:03:37 -07:00
constantize_test_cases.rb Fix constantize edge case involving prepend, autoloading and name conflicts 2016-12-14 14:25:43 +01:00
dependencies_test.rb Add Style/EmptyLinesAroundMethodBody in .rubocop.yml and remove extra empty lines 2017-02-12 20:44:15 +09:00
dependencies_test_helpers.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
deprecation_test.rb Send deprecation horizon and gem name as arguments to deprecation heavier handler, and make sure they are used for the ActiveSupport::Notifications message. 2017-04-19 18:23:28 -04:00
descendants_tracker_test_cases.rb Privatize unneededly protected methods in Active Support tests 2016-12-24 00:22:29 +09:00
descendants_tracker_with_autoloading_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
descendants_tracker_without_autoloading_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
evented_file_update_checker_test.rb Correct spelling 2017-02-05 19:00:18 -06:00
executor_test.rb "Use assert_nil if expecting nil. This will fail in minitest 6." 2016-12-25 02:29:52 +09:00
file_update_checker_shared_tests.rb remove unused variable 2017-02-01 08:20:13 +09:00
file_update_checker_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
gzip_test.rb Add missing gzip footer check in ActiveSupport::Gzip.decompress 2017-02-24 17:33:36 -05:00
hash_with_indifferent_access_test.rb Implement fetch_values for HashWithIndifferentAccess (#28316) 2017-04-10 10:20:13 +09:30
i18n_test.rb modernizes hash syntax in activesupport 2016-08-06 19:38:33 +02:00
inflector_test.rb Merge pull request #28480 from mubashirhanif/add_keep_id_suffix_option_to_humanize_new 2017-03-28 17:57:17 -04:00
inflector_test_cases.rb Merge pull request #28480 from mubashirhanif/add_keep_id_suffix_option_to_humanize_new 2017-03-28 17:57:17 -04:00
key_generator_test.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
lazy_load_hooks_test.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
log_subscriber_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
logger_test.rb improve error message when include assertions fail 2016-09-16 12:03:37 -07:00
message_encryptor_test.rb Updates to MessageEncryptor AEAD tests 2017-05-15 08:55:46 +00:00
message_verifier_test.rb assert_equal takes expectation first 2016-12-26 11:04:56 +09:00
multibyte_chars_test.rb Add Style/EmptyLinesAroundMethodBody in .rubocop.yml and remove extra empty lines 2017-02-12 20:44:15 +09:00
multibyte_conformance_test.rb Privatize unneededly protected methods in Active Support tests 2016-12-24 00:22:29 +09:00
multibyte_grapheme_break_conformance_test.rb Privatize unneededly protected methods in Active Support tests 2016-12-24 00:22:29 +09:00
multibyte_normalization_conformance_test.rb Privatize unneededly protected methods in Active Support tests 2016-12-24 00:22:29 +09:00
multibyte_proxy_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
multibyte_test_helpers.rb Update Unicode Version to 9.0.0 2017-01-28 16:57:36 +09:00
multibyte_unicode_database_test.rb Add Style/EmptyLines in .rubocop.yml and remove extra empty lines 2016-08-07 17:50:59 +09:00
notifications_test.rb Privatize unneededly protected methods in Active Support tests 2016-12-24 00:22:29 +09:00
number_helper_i18n_test.rb Missing require 'active_support/core_ext/hash/keys' 2017-01-29 08:41:06 +09:00
number_helper_test.rb Remove deprecated :prefix option 2016-11-13 23:09:03 +00:00
option_merger_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
ordered_hash_test.rb Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
ordered_options_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
reloader_test.rb Remove deprecated callbacks from ActionDispatch middlewares 2017-01-31 15:52:12 -05:00
rescuable_test.rb handle loops in the cause chain in Rescuable#rescue_with_handler 2017-05-10 13:33:46 -04:00
safe_buffer_test.rb "Use assert_nil if expecting nil from ...:in `...'. This will fail in minitest 6." 2016-12-25 13:15:56 +09:00
security_utils_test.rb Add test for variable_size_secure_compare 2017-01-31 20:41:14 +09:00
share_lock_test.rb Add three new rubocop rules 2016-08-16 04:30:11 -03:00
string_inquirer_test.rb Should do nothing here 2017-01-16 12:33:37 +09:00
subscriber_test.rb normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
tagged_logging_test.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
test_case_test.rb Privatize unneededly protected methods in Active Support tests 2016-12-24 00:22:29 +09:00
time_travel_test.rb Should escape meta characters in regexp 2017-05-07 04:10:00 +09:00
time_zone_test.rb Return unmapped timezones from country_zones 2017-03-28 13:33:32 +01:00
time_zone_test_helpers.rb applies new string literal convention in activesupport/test 2016-08-06 18:10:53 +02:00
transliterate_test.rb Raise ArgumentError if attempting to transliterate anything that is not a string 2017-01-16 14:40:41 -05:00
xml_mini_test.rb Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00