aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #32185 from nholden/human_readable_date_time_comparisonsRafael França2018-03-264-0/+50
|\ | | | | Add `before?` and `after?` methods to date and time classes
| * Add `before?` and `after?` methods to date and time classesNick Holden2018-03-064-0/+50
| | | | | | | | | | | | | | | | Equality comparisons between dates and times can take some extra time to comprehend. I tend to think of a date or time as "before" or "after" another date or time, but I naturally read `<` and `>` as "less than" and "greater than." This change seeks to make date/time comparisons more human readable.
* | Merge pull request #32315 from huacnlee/fix/local-cache-read-multi-entry-returnRafael França2018-03-221-0/+12
|\ \ | | | | | | Fix Cache `read_multi` with local_cache bug, should returns raw value, not `ActiveSupport::Cache::Entry` instance.
| * | Fix Cache `read_multi` with local_cache return values.Jason Lee2018-03-211-0/+12
| | | | | | | | | | | | It should returns raw value, not instance of `ActiveSupport::Cache::Entry`.
* | | Use try in tests that try to test try.Kasper Timm Hansen2018-03-211-7/+2
|/ /
* | Redis cache store: fix constructing with a Redis instanceAdam Richardson2018-03-121-0/+6
| | | | | | | | | | | | | | | | Since `Redis#call` duck types as a Proc, we'd call `#call` on it, thinking it's a Proc. Fixed by check for the Proc explicitly instead of duck typing on `#call`. References #32233
* | URI.unescape handles mixed Unicode/escaped inputAshe Connor2018-03-071-1/+1
|/ | | | | | | | | | | | | | | | | | Previously, URI.enscape could handle Unicode input (without any actual escaped characters), or input with escaped characters (but no actual Unicode characters) - not both. URI.unescape("\xe3\x83\x90") # => "バ" URI.unescape("%E3%83%90") # => "バ" URI.unescape("\xe3\x83\x90%E3%83%90") # => # Encoding::CompatibilityError We need to let `gsub` handle this for us, and then force back to the original encoding of the input. The result String will be mangled if the percent-encoded characters don't conform to the encoding of the String itself, but that goes without saying. Signed-off-by: Ashe Connor <ashe@kivikakk.ee>
* Deprecate "active_support/core_ext/numeric/inquiry"bogdanvlviv2018-03-021-80/+3
| | | | | | Numeric#positive? and Numeric#negative? was added to Ruby since 2.3, see https://github.com/ruby/ruby/blob/ruby_2_3/NEWS Rails 6 requires Ruby 2.4.1+ since https://github.com/rails/rails/pull/32034
* Deprecate `active_support/core_ext/hash/compact`yuuji.yaginuma2018-03-021-34/+4
| | | | | Ruby 2.4+ provides `Hash#compact` and `Hash#compact!` natively, so `active_support/core_ext/hash/compact` is no longer necessary.
* Remove unnecessary `respond_to?(:report_on_exception)` checkingyuuji.yaginuma2018-03-021-2/+2
| | | | Since Rails 6 requires Ruby 2.4.1+.
* Ruby 2.4: take advantage of String#unpack1Jeremy Daer2018-03-011-3/+3
| | | | | https://bugs.ruby-lang.org/issues/12752 https://ruby-doc.org/core-2.4.0/String.html#method-i-unpack1
* Add separate test to ensure that `delegate` with `:private` option returns ↵bogdanvlviv2018-02-281-6/+16
| | | | | | | | correct value Remove extra comments `# Asking for private method` in activesupport/test/core_ext/module_test.rb Improve docs of using `delegate` with `:private` Update changelog of #31944
* add private: true option for ActiveSupport delegateTomas Valent2018-02-261-0/+57
|
* Caching: MemCache and Redis stores use local cache for multi-readsGabriel Sobrinho2018-02-231-0/+10
| | | | | Fixes #31909. Closes #31911.
* Remove `AS::Multibyte`'s unicode tableFumiaki MATSUSHIMA2018-02-201-26/+0
|
* Return all mappings for a timezone id in `country_zones`Andrew White2018-02-191-0/+10
| | | | | | | | | | | | | | Some timezones like `Europe/London` have multiple mappings in `ActiveSupport::TimeZone::MAPPING` so return all of them instead of the first one found by using `Hash#value`. e.g: # Before ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh"] # After ActiveSupport::TimeZone.country_zones("GB") # => ["Edinburgh", "London"] Fixes #31668.
* String#truncate_bytes: limit to N bytes without breaking multibyte charsJeremy Daer2018-02-181-0/+62
| | | | | This faithfully preserves grapheme clusters (characters composed of other characters and combining marks) and other multibyte characters.
* `String#strip_heredoc` preserves frozennessJeremy Daer2018-02-171-0/+4
| | | | | | | | | | | | | | | | | | ```ruby "foo".freeze.strip_heredoc.frozen? # => true ``` Fixes the case where frozen string literals would inadvertently become unfrozen: ```ruby foo = <<-MSG.strip_heredoc la la la MSG foo.frozen? # => false !?? ```
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-174-79/+9
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Remove extra conditions in HWIDA since Rails 6 does not support Ruby 2.2bogdanvlviv2018-02-171-2/+0
| | | | See https://github.com/ruby/ruby/blob/ruby_2_3/NEWS
* Rails 6 requires Ruby 2.3+Jeremy Daer2018-02-172-3/+1
|
* Define transform_keys! in HashWithIndifferentAccessRafael Mendonça França2018-02-161-0/+13
| | | | | | | Make sure that when transforming the keys of a HashWithIndifferentAccess we can still access with indifferent access in Ruby 2.5. Closes #32007.
* Remove usage of strip_heredoc in the framework in favor of <<~Rafael Mendonça França2018-02-162-6/+5
| | | | | Some places we can't remove because Ruby still don't have a method equivalent to strip_heredoc to be called in an already existent string.
* Merge pull request #31866 from fatkodima/redis_cache-connection_poolRafael Mendonça França2018-02-142-2/+50
|\ | | | | | | Add support for connection pooling on RedisCacheStore
| * Add support for connection pooling on RedisCacheStorefatkodima2018-02-012-2/+50
| |
* | Add missing requireyuuji.yaginuma2018-02-081-0/+1
| | | | | | | | | | Without this require, an error occurs when executing only `duration_test.rb`. Ref: https://travis-ci.org/rails/rails/jobs/338817558#L2205-L2210
* | Merge pull request #31923 from jdelStrother/duration-deserializationRafael França2018-02-071-0/+6
|\ \ | | | | | | Fix yaml deserialization of ActiveSupport::Duration
| * | Fix yaml deserialization of ActiveSupport::DurationJonathan del Strother2018-02-071-0/+6
| | | | | | | | | | | | | | | | | | This ensures the duration's @parts hash has a default value, to avoid this regression introduced in 5.1: YAML.load(YAML.dump(10.minutes)) + 1 # => NoMethodError: undefined method `+' for nil:NilClass
* | | Use Redis#mget for RedisCacheStore#fetch_multifatkodima2018-02-051-0/+8
| | |
* | | Add missing instrumentation to RedisCacheStore#read_multifatkodima2018-02-056-17/+20
| | |
* | | RedisCacheStore: fix `#write_multi` mset serializationfatkodima2018-02-041-0/+10
| | | | | | | | | | | | | | | Closes #31886 Fixes #31884
* | | Merge pull request #28171 from sorra/fresh-thread-tagged-loggingRyuta Kamizono2018-02-031-1/+2
|\ \ \ | |_|/ |/| | Improve test for TaggedLogging "keeps each tag in their own thread"
| * | Merge branch 'master' into fresh-thread-tagged-loggingDongqing Hu2017-02-261-0/+13
| |\ \
| * | | Improve test for TaggedLogging "keeps each tag in their own thread"Dongqing Hu2017-02-261-1/+2
| | | |
* | | | Revert "Merge pull request #31447 from fatkodima/redis_cache-connection_pool"George Claghorn2018-01-311-32/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit ac74e2c521f6ddc0eac02d74a1313261bcc1d60f, reversing changes made to ffdb06136152b3c5f7f4a93ca5928e16e755d228.
* | | | Suppress expected exceptions by `report_on_exception` = `false`yuuji.yaginuma2018-01-291-0/+4
| | | | | | | | | | | | | | | | | | | | This suppresses `Timeout::Error` exceptions. Ref: https://travis-ci.org/rails/rails/jobs/334622442#L1089-L1110
* | | | Merge pull request #31803 from rmosolgo/rm-dependenciesRafael França2018-01-261-0/+55
|\ \ \ \ | | | | | | | | | | Fix infinite loop when unloading autoloaded modules
| * | | | Add failing test for infinite loop when unloading autoloaded modules when an ↵Robert Mosolgo2018-01-261-0/+55
| | | | | | | | | | | | | | | | | | | | error occured during the load.
* | | | | Remove extra whitespaceDaniel Colson2018-01-255-42/+42
| | | | |
* | | | | Use assert_empty and assert_not_emptyDaniel Colson2018-01-258-31/+31
| | | | |
* | | | | Use assert_predicate and assert_not_predicateDaniel Colson2018-01-2526-141/+141
| | | | |
* | | | | Change refute to assert_notDaniel Colson2018-01-251-2/+2
| | | | |
* | | | | Use respond_to test helpersDaniel Colson2018-01-2513-47/+47
| | | | |
* | | | | Improve fault tolerance for redis cache storefatkodima2018-01-234-6/+126
| | | | |
* | | | | Add support for connection pooling on RedisCacheStorefatkodima2018-01-224-50/+91
| | | | |
* | | | | Pass desired driver to Redis client constructor rather than munging global ↵George Claghorn2018-01-211-16/+12
|/ / / / | | | | | | | | | | | | config
* | | | Support hash as first argument in `assert_difference`. (#31600)Julien Meichelbeck2018-01-181-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support hash as first argument for `assert_difference`. This allows to specify multiple numeric differences in the same assertion. Example: assert_difference 'Article.count' => 1, 'Notification.count' => 2 do # post :create, params: { article: {...} } end * Support error message when passing a hash as a first parameter * Format CHANGELOG properly [Julien Meichelbeck + Rafael Mendonça França]
* | | | Support for connection pooling on mem cache storeGabriel Sobrinho2018-01-181-0/+74
| | | |
* | | | Test against the pure-Ruby Redis driverGeorge Claghorn2018-01-171-0/+6
| | | |
* | | | Fix constant referenceGeorge Claghorn2018-01-161-2/+1
| | | | | | | | | | | | | | | | Update the long key handling test so it triggers truncation in the Redis cache store.