aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/range_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug in Range comparisons when comparing to excluded-end RangeOwen Stephens2019-03-281-2/+6
| | | | | | | | | | | | | | | Before: ```ruby (1..10).cover?(1...11) => false ``` After: ```ruby (1..10).cover?(1...11) => true ``` See https://git.io/fjTtz for the commit against Ruby core that added support for Range arguments, with similar handling of this case.
* Change the empty block style to have space inside of the blockRafael Mendonça França2018-09-251-4/+4
|
* Replace `assert !` with `assert_not`Daniel Colson2018-04-191-3/+3
| | | | | This autocorrects the violations after adding a custom cop in 3305c78dcd.
* Enable `Layout/SpaceBeforeComma` rubocop rule, and fixed moreRyuta Kamizono2017-12-121-4/+4
| | | | Follow up of #31390.
* Allow `Range#include?` on TWZ rangesAndrew White2017-11-081-3/+6
| | | | | | | | | | | In #11474 we prevented TWZ ranges being iterated over which matched Ruby's handling of Time ranges and as a consequence `include?` stopped working with both Time ranges and TWZ ranges. However in ruby/ruby@b061634 support was added for `include?` to use `cover?` for 'linear' objects. Since we have no way of making Ruby consider TWZ instances as 'linear' we have to override `Range#include?`. Fixes #30799.
* Fix `to_s(:db)` for range comprising of alphabets.Aditya Kapoor2017-10-161-0/+5
|
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-3/+3
|
* improve error message when include assertions failMichael Grosser2016-09-161-3/+3
| | | | | | 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
* applies new string literal convention in activesupport/testXavier Noria2016-08-061-7/+7
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix - to_s(:db) on Numeric rangeAkshay Vishnoi2015-12-291-0/+6
|
* Fix grouped expression warning - `warning: (...) interpreted as grouped ↵Vipul A M2014-11-061-2/+2
| | | | expression`
* Fix DateTime comparison with DateTime::Infinity objectRafael Mendonça França2014-08-061-0/+1
| | | | Fixes #16406
* missing activesupport test coverageEugene Gilburg2014-07-191-1/+6
|
* Fix iterating over DateTime by doing strict checking for Time objectsPrathamesh Sonpatki2014-01-111-0/+4
| | | | - Fixes #13667
* Typo fixAkshay Vishnoi2013-11-291-1/+1
|
* Disable ability to iterate over a Range of TimeWithZoneBogdan Gusiev2013-07-191-0/+22
|
* Fix some typo in method names, variablesVipul A M2013-05-261-1/+1
|
* Squashed commit of the following:Aaron Patterson2013-05-031-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 2683de5da85135e8d9fe48593ff6167db9d64b18 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:29:20 2013 -0700 cannot support infinite ranges right now commit cebb6acef2c3957f975f6db4afd849e535126253 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:26:12 2013 -0700 reverting infinity comparison commit 385f7e6b4efd1bf9b89e8d607fcb13e5b03737ea Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:23:28 2013 -0700 Revert "Added ability to compare date/time with infinity" This reverts commit 38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1. Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/core_ext/numeric/infinite_comparable.rb activesupport/test/core_ext/date_ext_test.rb activesupport/test/core_ext/date_time_ext_test.rb activesupport/test/core_ext/numeric_ext_test.rb activesupport/test/core_ext/time_ext_test.rb activesupport/test/core_ext/time_with_zone_test.rb commit 0d799a188dc12b18267fc8421675729917610047 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:18:53 2013 -0700 Revert "Refactor infinite comparable definition a bit" This reverts commit dd3360e05e4909f2f0c74a624cccc2def688f828. commit 42dec90e49745bbfae546f0560b8783f6b48b074 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:18:47 2013 -0700 Revert "Require 'active_support/core_ext/module/aliasing' in the infinite_comparable module" This reverts commit 7003e71c13c53ec3d34250560fbf80b8381df693.
* Test to allow Range including DateTime and DateTime::Infinitygsphanikumar2013-01-141-0/+6
| | | | Closes #8587
* Added ability to compare date/time with infinitybUg2013-01-041-0/+25
| | | | | | | | | | | | | | | | | Date, DateTime, Time and TimeWithZone can now be compared to infinity, so it's now possible to create ranges with one infinite bound and date/time object as another bound. Ex.: @range = Range.new(Date.today, Float::INFINITY) Also it's possible to check inclusion of date/time in range with conversion. Ex.: @range.include?(Time.now + 1.year) # => true @range.include?(DateTime.now + 1.year) # => true Ability to create date/time ranges with infinite bound is required for handling postgresql range types.
* remove useless tests for Range#stepVasiliy Ermolovich2012-05-131-10/+0
|
* Remove blockless_step leave all that up to RubySantiago Pastorino2012-05-131-1/+1
| | | | Closes #6297
* Added tests for comparsion operator for RangeAlexey Gaziev2012-05-071-0/+12
|
* make Range#overlaps? accept Range of TimeShigeya Suzuki2012-02-091-0/+12
|
* use AS::TestCase as the base classAaron Patterson2012-01-051-1/+1
|
* fix a warning about grouped expressionsVijay Dev2012-01-011-1/+1
|
* refactor Range#include? to handle ranges with floatsSergey Nartimov2011-12-291-0/+4
|
* Initial pass at removing dead 1.8.x code from Active Support.José Valim2011-12-201-10/+3
| | | | | | There are a bunch of other implicit branches that adds 1.8.x specific code that still needs to be removed. Pull requests for those cases are welcome.
* added Range#count? for Ruby 1.8Diego Carrion2011-02-191-0/+12
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Repair time dependenciesJeremy Kemper2009-11-141-1/+1
|
* Fix dependencies revealed by testing in isolationJeremy Kemper2009-04-221-0/+1
|
* Explicit test dependenciesJeremy Kemper2009-03-281-0/+1
|
* require abstract_unit directly since test is in load pathJeremy Kemper2008-01-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Style update for new Range extensionsJeremy Kemper2007-10-091-6/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7818 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* * Add Range#overlaps?(range), Range#include?(range), and Range#step without ↵Michael Koziarski2007-10-081-0/+51
| | | | | | a block. [brandon] Closes #9746 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7800 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4487@asus: jeremy | 2006-04-29 12:21:39 -0700Jeremy Kemper2006-07-081-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check whether @flash is defined? for warnings-safety. r4488@asus: jeremy | 2006-04-29 12:23:15 -0700 Check whether @flash is defined? for warnings-safety. Obviates nil? check. r4489@asus: jeremy | 2006-04-29 12:45:18 -0700 Check whether @session is defined? for warnings-safety. r4490@asus: jeremy | 2006-04-29 12:50:41 -0700 Check whether @rendering_runtime is defined? for warnings-safety. r4491@asus: jeremy | 2006-04-29 12:55:01 -0700 Check whether @_cycles is defined? for warnings-safety. r4492@asus: jeremy | 2006-04-29 12:59:19 -0700 Check whether instance variables are defined? for warnings-safety. r4493@asus: jeremy | 2006-04-29 13:14:09 -0700 Add nil @template to PrototypeHelperTest to suppress unitialized instance variable warning. r4494@asus: jeremy | 2006-04-29 13:31:34 -0700 Check whether @auto_index defined? for warnings-safety. r4495@asus: jeremy | 2006-04-29 13:32:24 -0700 Wrap content_columns redefinitions with silence_warnings. r4496@asus: jeremy | 2006-04-29 13:35:28 -0700 Wrap more redefinitions with silence_warnings. r4829@asus: jeremy | 2006-07-08 10:59:20 -0700 abstract unit, fix warnings r4830@asus: jeremy | 2006-07-08 11:06:12 -0700 Use parens to silence warning. r4831@asus: jeremy | 2006-07-08 11:06:48 -0700 Use parens to silence warning. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added to_s(:db) to RangeDavid Heinemeier Hansson2005-10-091-0/+16
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2506 5ecf4fe2-1ee6-0310-87b1-e25e094e27de