aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
Commit message (Collapse)AuthorAgeFilesLines
* Test for the new exception of delegate_missing_to (#30191)Anton Khamets2017-08-121-0/+8
| | | | | | | | | | | | | | | * Add test for the new exception of delegate_missing_to * Add a changelog entry * Only check for nil if NoMethodError was raised * Make method private * Have to pass both target name and value * Inline the re-raise [Rafael Mendonça França + Anton Khamets]
* Merge pull request #30039 from ricardotk002/fix-string-camelize-invalid-optionSean Griffin2017-08-031-0/+7
|\ | | | | Update String#camelize to provide feedback when a wrong option is sent
| * Update String#camelize to provide feedback when wrong option is passedRicardo Díaz2017-08-021-0/+7
| | | | | | | | | | | | | | | | | | String#camelize was returning nil without any feedback when an invalid option was passed as parameter. This update makes the method to raises an ArgumentError when the option passed is invalid, similar to what Ruby does for String#downcase (and others) in 2.4.1. https://ruby-doc.org/core-2.4.1/String.html#method-i-downcase
* | Merge pull request #29958 from znz/file-nullMatthew Draper2017-08-021-1/+1
|\ \ | | | | | | Use File::NULL instead of "/dev/null"
| * | Use File::NULL instead of "/dev/null"Kazuhiro NISHIYAMA2017-07-311-1/+1
| |/
* | Merge remote-tracking branch 'origin/master' into unlock-minitestRafael Mendonça França2017-08-01199-18/+477
|\|
| * Add missing support for modulo operations on durationsSayan Chakraborty2017-07-281-13/+62
| | | | | | | | | | | | | | | | | | | | | | Rails 5.1 introduce an `ActiveSupport::Duration::Scalar` class as a wrapper around a numeric value as a way of ensuring a duration was the outcome of an expression. However the implementation was missing support for modulo operations. This commit adds support for those operations and should result in a duration being returned from expressions involving them. Fixes #29603 and #29743.
| * Fix division where a duration is the denominatorAndrew White2017-07-271-10/+14
| | | | | | | | | | | | | | | | | | PR #29163 introduced a change in behavior when a duration was the denominator in a calculation - this was incorrect as dividing by a duration should always return a `Numeric`. The behavior of previous versions of Rails has been restored. Fixes #29592.
| * remove depreciated assertion to eliminate warningChristina Thompson2017-07-241-1/+1
| | | | | | | | Signed-off-by: Yuki Nishijima <yk.nishijima@gmail.com>
| * Merge pull request #29907 from deivid-rodriguez/fix_flaky_message_verifier_testKasper Timm Hansen2017-07-241-1/+1
| |\ | | | | | | Fix test failure in message verifier tests
| | * Fix test failure in message verifier testsDavid Rodríguez2017-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this, I get the following result on my machine ``` # Running: F Failure: MessageVerifierTest#test_backward_compatibility_messages_signed_without_metadata [/home/deivid/Code/rails/activesupport/test/message_verifier_test.rb:91]: --- expected +++ actual @@ -1 +1 @@ -{:some=>"data", :now=>2010-01-01 00:00:00 +0100} +{:some=>"data", :now=>2010-01-01 00:00:00 +0000} bin/test test/message_verifier_test.rb:89 ```
| * | add metadata tests: verify methodAssain2017-07-241-0/+15
| |/
| * Merge pull request #29860 from georgeclaghorn/travel-back-automaticallyRafael França2017-07-241-3/+0
| |\ | | | | | | Remove time stubs after each test
| | * Remove time stubs after each testGeorge Claghorn2017-07-221-3/+0
| | | | | | | | | | | | Reverts 7abb6e0.
| * | add metadata support to message verifierAssain2017-07-191-0/+41
| | |
| * | Add expires_at, expires_in, and purpose meta_data to messages.Assain2017-07-192-1/+131
| | |
| * | Merge pull request #29757 from lugray/hash_with_indifferent_access_defaultSean Griffin2017-07-171-0/+26
| |\ \ | | | | | | | | Fix HashWithIndifferentAccess#default when include?(nil)
| | * | Fix HashWithIndifferentAccess#default when include?(nil)Lisa Ugray2017-07-171-0/+26
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of HashWithIndifferentAccess#default didn't distinguish `default` from `default(nil)`, which caused an incorrect result for `default` if `nil` was used as a key. Define HashWithIndifferentAccess#dig so that hackery that behaves differently from Hash#default can be removed from HashWithIndifferentAccess#default.
| * | Merge branch 'master' into make-reverse-merge-bang-order-consistentSean Griffin2017-07-17199-2010/+3389
| |\ \
| | * | Enable `Layout/FirstParameterIndentation` copRyuta Kamizono2017-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have some indentation cops. But now there is a little inconsistent params indentations. Enable `Layout/FirstParameterIndentation` cop to prevent newly inconsistent indentation added and auto-correct to existing violations.
| | * | Remove encoding utf-8 magic commentKoichi ITO2017-07-152-2/+0
| | |/
| | * [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-11196-0/+196
| | |
| * | Make the order of Hash#reverse_merge! consistent with HashWithIndifferentAccessErol Fornoles2017-03-061-2/+5
| | |
* | | Merge branch 'master' into unlock-minitestKasper Timm Hansen2017-07-15199-1330/+1732
|\ \ \ | | |/ | |/|
| * | Added time helper method `freeze_time` which is an alias for `travel_to ↵प्रथमेश Sonpatki2017-07-101-0/+22
| | | | | | | | | | | | Time.now` (#29681)
| * | Merge pull request #29728 from kirs/frozen-activesupportMatthew Draper2017-07-09198-0/+198
| |\ \ | | | | | | | | Use frozen-string-literal in ActiveSupport
| | * | Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-09198-0/+198
| | | |
| * | | Merge pull request #28668 from Dorian/mention-time-parse-argument-errorAaron Patterson2017-07-051-0/+10
| |\ \ \ | | | | | | | | | | Mention Time.zone.parse possibly throwing ArgumentError
| | * | | Mention and test for possible ArgumentError when parsing timesDorian Marié2017-04-081-0/+10
| | | | |
| * | | | Fix warning: `*' interpreted as argument prefixRyuta Kamizono2017-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` /Users/kamipo/src/github.com/rails/rails/activesupport/test/core_ext/module_test.rb:402: warning: `*' interpreted as argument prefix /Users/kamipo/src/github.com/rails/rails/activesupport/test/core_ext/module_test.rb:420: warning: `*' interpreted as argument prefix ```
| * | | | Merge pull request #29687 from k3rni/private-prefixed-delegateMatthew Draper2017-07-061-0/+38
| |\ \ \ \ | | |_|/ / | |/| | | | | | | | Return prefixed method names from `Module.delegate`, if using prefixes
| | * | | Use `map` in `delegate` so that actual prefixed method names are returned, ↵Krzysztof Zych2017-07-051-0/+39
| |/ / / | | | | | | | | | | | | if using prefix version.
| * | | Expectation firstAkira Matsuda2017-07-021-1/+1
| | | |
| * | | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-02198-198/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
| * | | Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-02198-0/+198
| |\ \ \ | | | | | | | | | | | | | | | Enforce frozen string in Rubocop
| | * | | Enforce frozen string in RubocopKir Shatrov2017-07-01198-0/+198
| | | | |
| * | | | Merge pull request #29506 from pat/frozen-string-literalsMatthew Draper2017-07-027-33/+34
| |\ \ \ \ | | |/ / / | |/| | | | | | | | Make ActiveSupport frozen-string-literal friendly.
| | * | | Make ActiveSupport frozen string literal friendly.Pat Allan2017-06-207-33/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ActiveSupport test suite only passes currently if it uses the latest unreleased commits for dalli, and a patch for Builder: https://github.com/tenderlove/builder/pull/6 Beyond that, all external dependencies (at least, to the extent they’re used by ActiveSupport) are happy, including Nokogiri as of 1.8.0.
| * | | | prepare for Minitest 6utilum2017-06-201-1/+1
| |/ / /
| * | | Cache: test coverage for cleanup behavior with local cache strategyEugene Kenny2017-06-101-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | No need to pass `#cleanup` options through to `LocalCache#clear`. Fixes #29081. References #25628.
| * | | Split up the cache test suite so it's easier to understand and extend (#29404)Jeremy Daer2017-06-1020-1359/+1383
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split up the caching tests as prep for adding a new cache store. Slices the mega test/caching_test.rb into behavior modules, concrete store tests, and cross-cutting store tests. Considering moving cache store behavior modules into lib/ so they may be used for acceptance testing by third parties.
| * | | Cache: write_multi (#29366)Jeremy Daer2017-06-061-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails.cache.write_multi foo: 'bar', baz: 'qux' Plus faster `fetch_multi` with stores that implement `write_multi_entries`. Keys that aren't found may be written to the cache store in one shot instead of separate writes. The default implementation simply calls `write_entry` for each entry. Stores may override if they're capable of one-shot bulk writes, like Redis `MSET`.
| * | | Implement mattr_acessor :default optionGenadi Samokovarov2017-06-031-1/+37
| | | |
* | | | Merge branch 'master' into unlock-minitestRafael Mendonça França2017-06-021-0/+22
|\| | |
| * | | Add next occur and previous occurred day of week API (#26600)Shota Iguchi2017-05-301-0/+22
| | | |
* | | | Reset time zone to previous valueyuuji.yaginuma2017-05-301-1/+8
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since `CurrentAttributesTest` changed the global time zone, it is necessary to restore the original value after changing the test. The reproduction step: ``` ./bin/test -w --seed 5549 test/current_attributes_test.rb test/core_ext/date_ext_test.rb ```
* | | Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* | | Merge pull request #26628 from mjhoy/fix-number-to-human-25742Eileen M. Uchitelle2017-05-291-0/+6
|\ \ \ | | | | | | | | round before calculating exponent in number_to_human_converter
| * | | number_to_human_converter: round before calculating exponentMichael Hoy2017-03-161-0/+6
| | | | | | | | | | | | | | | | fixes #25664
* | | | Merge pull request #29097 from ↵Matthew Draper2017-05-281-0/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | EilisHamilton/fix_uncountable_pluralization_locale Fix pluralization of uncountables when given a locale