aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
Commit message (Collapse)AuthorAgeFilesLines
* Do not include `ActiveSupport` into test classesJon Moss2016-11-193-33/+27
| | | | | | | | | | | Will help get rid of errors like the following: ``` 1) Error: JDOMEngineTest#test_order=: ArgumentError: wrong number of arguments (0 for 1) /Users/jon/code/rails/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb:106:in `test_order=' ```
* Call fallback exception handlers with the right exceptionSean Griffin2016-11-171-1/+1
| | | | | | | | The issue presented in #26246 showed a deeper underlying problem. When we fell back to the exception handler for an exceptions cause, we were calling that handler with the outer raised exception. This breaks the calling code's expectations, especially if the exception has methods on it behond those from `StandardError`.
* Merge pull request #27035 from rails/remove-active-support-deprecationsAndrew White2016-11-149-457/+0
|\ | | | | Remove Active Support deprecations
| * Remove deprecated separator argument from parameterizeAndrew White2016-11-142-34/+0
| |
| * Remove deprecated method Numeric#to_formatted_sAndrew White2016-11-141-6/+0
| |
| * Remove deprecated method alias_method_chainAndrew White2016-11-141-215/+0
| |
| * Remove deprecated constant MissingSourceFIleAndrew White2016-11-141-8/+0
| |
| * Remove deprecated Module.qualified_const_get/set/defined?Andrew White2016-11-141-118/+0
| |
| * Remove deprecated :prefix optionAndrew White2016-11-132-32/+0
| |
| * Remove deprecated new_from_hash_copying_defaultAndrew White2016-11-131-7/+0
| |
| * Remove deprecated local_constantsAndrew White2016-11-131-10/+0
| |
| * Remove deprecated namespaced_keyAndrew White2016-11-131-6/+0
| |
| * Remove deprecated set_cache_valueAndrew White2016-11-131-9/+0
| |
| * Remove deprecated escape_keyAndrew White2016-11-131-6/+0
| |
| * Remove deprecated key_file_pathAndrew White2016-11-131-6/+0
| |
* | Revert "Merge pull request #25811 from oss92/to_sentence_fallback_string"Rafael Mendonça França2016-11-141-6/+1
| | | | | | | | | | | | | | | | This reverts commit bad3a120f1690f393d8f6204b3ceee60f0ce707b, reversing changes made to 2384317465ccb1dfca456a2b7798714b99f32711. Reason: Adding a new option in the API for something that can be done with a `#presence` check could do.
* | Remove warning from access to Bignum class, 2**64 is already a known bignum ↵Vipul A M2016-11-131-1/+0
|/ | | | value. See also http://patshaughnessy.net/2014/1/9/how-big-is-a-bignum for smallest bignum value
* Fix typo in constant referenceAndrew White2016-11-131-1/+1
|
* It's a NAN not InfinityAndrew White2016-11-131-1/+1
|
* Use literal values in assertionsAndrew White2016-11-131-6/+4
| | | | | Using the method you're testing to generate expected values can lead to bugs being masked.
* Merge pull request #26933 from prathamesh-sonpatki/fix-26877Andrew White2016-11-131-0/+22
|\ | | | | Fix an issue with JSON encoding of "Infinity" and "NaN" values
| * Fix an issue with JSON encoding of "Infinity" and "NaN" valuesPrathamesh Sonpatki2016-10-301-0/+22
| | | | | | | | | | | | | | | | | | | | | | - When `as_json` returns `Infinity` or `NaN` as the value of any of the key, we don't used to call `as_json` on it as it was treated as primitive. - This used to pass `Infinity` or `NaN` to `JSON.generate` and Ruby used to throw an error for `Infinity/NaN not allowed in JSON.` - This patch changes the code to call `as_json` on these primitives so that they are converted to proper values before being passed to `JSON.generate`. - Fixes #26877.
* | Tweaking some test data due to sprintf behavior change in 2.4Akira Matsuda2016-11-051-5/+5
| | | | | | | | | | | | | | | | 2.3: sprintf('%0.1f', 5.55) #=> "5.5" 2.4: sprintf('%0.1f', 5.55) #=> "5.6" see: https://github.com/ruby/ruby/commit/6ed8c79ddb11ccfb580bb0a22b22cc1362250255 and https://github.com/ruby/ruby/commit/295f60b94d5ff6551fab7c55e18d1ffa6a4cf7e3
* | Ensure duration parsing is consistent across DST changesAndrew White2016-10-311-0/+31
|/ | | | | | | | | | | | | | | | | | Previously `ActiveSupport::Duration.parse` used `Time.current` and `Time#advance` to calculate the number of seconds in the duration from an arbitrary collection of parts. However as `advance` tries to be consistent across DST boundaries this meant that either the duration was shorter or longer depending on the time of year. This was fixed by using an absolute reference point in UTC which isn't subject to DST transitions. An arbitrary date of Jan 1st, 2000 was chosen for no other reason that it seemed appropriate. Additionally, duration parsing should now be marginally faster as we are no longer creating instances of `ActiveSupport::TimeWithZone` every time we parse a duration string. Fixes #26941.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-2935-960/+960
|
* Merge pull request #26843 from denisovlev/strptime_timestampsRafael França2016-10-221-0/+18
|\ | | | | Fix `ActiveSupport::TimeZone#strptime` cannot parse timestamps (%Q, %s)
| * Fix `ActiveSupport::TimeZone#strptime` cannot parse timestamps (%Q, %s)denisovlev2016-10-211-0/+18
| |
* | Skip test that depends on RubyVM when it is not available (JRuby).Charles Oliver Nutter2016-10-211-0/+2
|/
* Merge pull request #26839 from renuo/fix-missing-nsec-transferAndrew White2016-10-211-1/+3
|\ | | | | Fix copy_time_to: Copy nsec instead of usec
| * Fix copy_time_to: Copy nsec instead of usecJosua Schmid2016-10-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | `copy_time_to` is a helper function for date and time calculations. It's being used by `prev_week`, `next_week` and `prev_weekday` to keep the time fraction when jumping around between days. Previously the nanoseconds part was lost during the operation. This lead to problems in practice if you were using the `end_of_day` calculation. Resulting in the time fraction of `end_of_day` not being the same as next week's `end_of_day`. With this fix `copy_time_to` doesn't forget the `nsec` digits.
* | Merge pull request #26830 from headius/mask_forking_fsevent_test_on_jrubyRafael Mendonça França2016-10-201-0/+2
| | | | | | | | Mask forking filesystem event on JRuby.
* | Merge pull request #26829 from headius/wait_for_events_in_listen_testsAaron Patterson2016-10-191-0/+18
|/ | | | Wait for file events to propagated for slower Listen backends.
* Fixnum and Bignum are deprecated in Ruby trunkMatthew Draper2016-10-081-2/+2
| | | | https://bugs.ruby-lang.org/issues/12739
* Merge pull request #26684 from matthewd/executor-serialMatthew Draper2016-10-051-0/+55
|\ | | | | Avoid bumping the class serial when invoking executor
| * Avoid bumping the class serial when invoking executorMatthew Draper2016-10-031-0/+55
| |
* | Revert "Merge pull request #26677 from tbalthazar/26644"Andrew White2016-10-021-6/+0
|/ | | | | | | | Turns out trying to cache on localtime with arguments is too hard so we'll do it on DateAndTime::Compatibility#to_time instead. This reverts commit 9ce2d1b1a43fc4ef3db59849b7412d30583a4074, reversing changes made to 53ede1aff2025d4391d0e05ba471fdaf3110a99c.
* Merge pull request #26677 from tbalthazar/26644Andrew White2016-10-011-0/+6
|\ | | | | Fix `ActiveSupport::TimeWithZone#localtime`
| * Fix `ActiveSupport::TimeWithZone#localtime`Thomas Balthazar2016-10-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously memoization in `localtime` wasn't taking the `utc_offset` parameter into account when returning a cached value. It now caches the computed value depending on the `utc_offset` parameter, e.g: Time.zone = "US/Eastern" t = Time.zone.local(2016,5,2,11) # => Mon, 02 May 2016 11:00:00 EDT -04:00 t.localtime(-7200) # => 2016-05-02 13:00:00 -0200 t.localtime(-3600) # => 2016-05-02 14:00:00 -0100
* | Tighten the backtrace pollution from passing through callbacksMatthew Draper2016-09-301-1/+72
|/ | | | | | | | | | Callbacks are everywhere, so it's better if we can avoid making a mess of the backtrace just because we've passed through a callback hook. I'm making no effort to the before/after invocations: those only affect backtraces while they're running. The calls that matter are the ones that remain on the call stack after run_callbacks yields: around callbacks, and internal book-keeping around the before/afters.
* Fix ActiveSupport::TimeWithZone#inThomas Balthazar2016-09-241-1/+31
| | | | | | | | | | | | | | | Previously calls to `in` were being sent to the non-DST aware method `Time#since` via `method_missing`. It is now aliased to the DST aware `ActiveSupport::TimeWithZone#+` which handles transitions across DST boundaries, e.g: Time.zone = "US/Eastern" t = Time.zone.local(2016,11,6,1) # => Sun, 06 Nov 2016 01:00:00 EDT -05:00 t.in(1.hour) # => Sun, 06 Nov 2016 01:00:00 EST -05:00
* add check of argumentyuuji.yaginuma2016-09-171-0/+6
| | | | | | | `#fetch_multi` in case did not cache hit, to write a cache using the block value. https://github.com/rails/rails/blob/master/activesupport/lib/active_support/cache.rb#L383..L384 Therefore, block is a need to pass always, I think should check first.
* improve error message when include assertions failMichael Grosser2016-09-1612-114/+114
| | | | | | assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-6/+6
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Remove blank else branchRyuta Kamizono2016-09-031-3/+0
|
* RuboCop is 100% green :tada:Xavier Noria2016-09-021-1/+5
|
* fixes remaining RuboCop issues [Vipul A M, Xavier Noria]Xavier Noria2016-09-012-2/+2
|
* Start passing cipher from EncryptedCookieJar since we use it to determine ↵Vipul A M2016-09-011-2/+2
| | | | key length
* Follow up of #25602Vipul A M2016-09-011-0/+10
| | | | | | | | | Since keys are truncated, ruby 2.4 doesn't accept keys greater than their lenghts. keys of same value but different lenght and greater than key size of cipher, produce the same results as reproduced at https://gist.github.com/rhenium/b81355fe816dcfae459cc5eadfc4f6f9 Since our default cipher is 'aes-256-cbc', key length for which is 32 bytes, limit the length of key being passed to Encryptor to 32 bytes. This continues to support backwards compat with any existing signed data, already encrupted and signed with 32+ byte keys. Also fixes the passing of this value in multiple tests.
* use `message` that specified in argument to error messageyuuji.yaginuma2016-08-311-0/+9
|
* use `inspect` for show `from` valueyuuji.yaginuma2016-08-291-0/+9
| | | | If `from` is nil, in order to avoid the blank is showed.