aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
Commit message (Collapse)AuthorAgeFilesLines
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-033-3/+0
| | | | onwards.
* Return value of yielded block in File.atomic_writeIan Ker-Seymer2015-01-281-0/+10
| | | | | | Staying true to Ruby convention, we now return the value of the yielded block from `File.atomic_write {...}`. This mimics the behavior of MRI's `File.open {...}`.
* - Moved hwia frozen value assignment test to hash_ext_test similar to other ↵Vipul A M2015-01-171-0/+8
| | | | | | | tests - Fixed the wrong use of with_indifferent_access on hash in the test which failed for isolated tests - Renamed to appropriately specify what the test does
* Removing :en in favor of I18n.default_locale in duration#inspectDominik Masur2015-01-121-0/+9
| | | | | | | | | | | | | | | | | Hi there, i have an app without english as available locale. So i got an error when we try to inspect something like 1.day. This is done automatically when we use the dalli cache. I would like to change the :en to ::I18n.default_locale to be sure that this is always constant and is an available locale. Tests are all green with this change. Calculating ------------------------------------- :locale => :en 2.024k i/100ms :locale => ::I18n.default_locale 2.236k i/100ms ------------------------------------------------- :locale => :en 25.758k (±26.3%) i/s - 117.392k :locale => ::I18n.default_locale 26.311k (±18.1%) i/s - 127.452k
* Add SecureRandom.base58Guillermo Iguaran2015-01-091-0/+20
|
* Add #prev_day and #next_day as counterparts to #yesterday and #tomorrow for ↵George Claghorn2015-01-061-0/+10
| | | | Date, Time, and DateTime
* Add same_time option to #prev_week and #next_week for Date, Time, and DateTimeGeorge Claghorn2015-01-061-0/+15
|
* Add #on_weekend?, #next_weekday, and #prev_weekday methods to Date, Time, ↵George Claghorn2015-01-061-0/+45
| | | | | | | | | | | | | and DateTime `#on_weekend?` returns true if the receiving date/time falls on a Saturday or Sunday. `#next_weekday` returns a new date/time representing the next day that does not fall on a Saturday or Sunday. `#prev_weekday` returns a new date/time representing the previous day that does not fall on a Saturday or Sunday.
* Remove Struct#to_h backportRafael Mendonça França2015-01-041-10/+0
|
* Remove debugger supportRafael Mendonça França2015-01-041-24/+0
| | | | | bebugger doesn't work with Ruby 2.2 so we don't need to support it anymore
* Remove hack to support BigDecimal in Ruby 1.9claudiob2015-01-041-10/+1
| | | | | Now that Rails requires Ruby >= 2.0, there is no need to check whether `BigDecimal` exists or not.
* Remove deprecated `ActiveSupport::SafeBuffer#prepend`Rafael Mendonça França2015-01-041-10/+0
|
* Remove deprecated methods at `Kernel`.Rafael Mendonça França2015-01-041-47/+0
| | | | `silence_stderr`, `silence_stream`, `capture` and `quietly`.
* Remove deprecated core_ext/big_decimal/yaml_conversions fileRafael Mendonça França2015-01-041-11/+0
|
* Deprecate `MissingSourceFile` in favor of `LoadError`.Rafael Mendonça França2015-01-021-0/+9
| | | | | `MissingSourceFile` was just an alias to `LoadError` and was not being raised inside the framework.
* Merge pull request #8740 from amatsuda/missing_source_fileRafael Mendonça França2015-01-021-24/+0
|\ | | | | | | | | | | | | replace use of MissingSourceFile with LoadError Conflicts: activesupport/test/core_ext/load_error_test.rb
| * replace use of MissingSourceFile with LoadErrorAkira Matsuda2013-01-041-16/+1
| |
* | Remove thread variables backportRafael Mendonça França2015-01-021-75/+0
| | | | | | | | They are already present on Ruby 2.2
* | Merge pull request #16749 from robin850/rbx-name-errorRafael Mendonça França2015-01-021-0/+2
|\ \ | | | | | | Rely on NameError#name instead of its error message
| * | Skip an error message related assertion on RubiniusRobin Dupret2014-10-281-0/+2
| | | | | | | | | | | | | | | | | | Rubinius' error messages don't call `#inspect` on the concerned object while the assertion is here to address a wrong inspection on MRI with time zones so let's keep this test for now on Rubinius.
* | | Removed Object#itself as it's implemented in ruby 2.2Cristian Bica2014-12-291-9/+0
| | |
* | | Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-294-11/+7
| | |
* | | Merge pull request #17493 from petewest/duration-comparableAaron Patterson2014-11-071-0/+12
|\ \ \ | | | | | | | | Delegate comparison operator to value
| * | | Delegate comparison operator to valuePeter West2014-11-031-0/+12
| | | |
* | | | Fix grouped expression warning - `warning: (...) interpreted as grouped ↵Vipul A M2014-11-061-2/+2
| | | | | | | | | | | | | | | | expression`
* | | | added example of squish!, remove, test case for multiple occurrence ofRishi Jain2014-11-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pattern removal added example for string#remove and test case for remove of multiple occurence of pattern removed extra whitespaces
* | | | tests, add note about the usage of a specific timezone. Closes #17448.Yves Senn2014-11-051-1/+1
| | | |
* | | | Merge pull request #17515 from prathamesh-sonpatki/rm-requireYves Senn2014-11-051-1/+0
|\ \ \ \ | | | | | | | | | | Removed the unused require of proxy_object
| * | | | Removed the unused require of proxy_object and test related to itPrathamesh Sonpatki2014-11-051-1/+0
| |/ / / | | | | | | | | | | | | | | | | - Reference : https://github.com/rails/rails/pull/17493#issuecomment-61739359 - Duration stopped inheriting from ProxyObject in https://github.com/rails/rails/pull/16574
* / / / Fix broken string_ext_test due to change in timezonePrathamesh Sonpatki2014-11-051-1/+1
|/ / / | | | | | | | | | | | | - Russian time was changed to UTC+3 from UTC+4 recently. This broke the string_to_ext test.
* | | Merge pull request #17383 from rwz/string-removeRafael Mendonça França2014-11-031-2/+12
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Make `String#remove` and `String#remove!` accept multiple arguments Conflicts: activesupport/CHANGELOG.md
| * | | Make `String#remove` and `String#remove!` accept multiple argumentsPavel Pravosud2014-10-251-2/+12
| | | |
* | | | Optimize TimeWithZoneTest#strftimePablo Herrero2014-10-271-0/+5
|/ / /
* | | Bring try! into parity with try.Ari Pollak2014-10-221-4/+8
| | | | | | | | | | | | Based on commit 5e51bdda.
* | | define hash on durationlsylvester2014-10-031-0/+4
| | |
* | | Fix another false assertionsYuki Nishijima2014-09-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The assertions in AS::Duration don't actually assert. * The assertion in Railtie will pass even when `eager_load_namespaces` doesn't include `AppTemplate::Application` if `Rails.application` is truthy. For more details, see here: * https://github.com/rails/rails/pull/16998 * https://github.com/rails/rails/pull/17000
* | | Delegation works with reserved words passed to `:to`Agis-2014-09-191-0/+11
| | | | | | | | | | | | Fixes #16956.
* | | Merge pull request #11794 from yoazt/duration-eqlRafael Mendonça França2014-09-171-0/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added method `#eql?` to `ActiveSupport::Duration`, in addition to `#==`. Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/duration.rb activesupport/test/core_ext/duration_test.rb
| * | | Added method `#eql?` to `ActiveSupport::Duration`, in addition to `#==`.Joost Lubach2013-08-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the following returns `false`, contrary to expectation: 1.minute.eql?(1.minute) Adding method `#eql?` will make this behave like expected. Method `#eql?` is just a bit stricter than `#==`, as it checks whether the argument is also a uration. Their parts may be different though. 1.minute.eql?(60.seconds) # => true 1.minute.eql?(60) # => false
* | | | As of Unicode 6.3, Mongolian Vowel Separator is not whitespaceMatthew Draper2014-09-151-3/+3
| | | | | | | | | | | | | | | | | | | | Ruby 2.2 knows this, and no longer matches it with [[:space:]], so it's not a good candidate for testing String#squish.
* | | | add implementation of respond_to? for ActiveSupport::Durationlsylvester2014-09-152-1/+10
| | | |
* | | | Time#change can now change nanoseconds (:nsec)Agis-2014-09-141-0/+7
| | | | | | | | | | | | | | | | Closes #16392.
* | | | Time#change throws exception with an out-of-range :usecAgis-2014-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/rails/rails/commit/98b46bf5e201307cae56ee14bf41363a539779c5 did not properly handled out-of-range `:usec`s. Passing a `:usec` that's out of range now throws an `ArgumentError` as it should. Fixes #16759.
* | | | Methods are not duplicable.Peter Jaros2014-09-031-1/+1
| | | |
* | | | Bring back the test cases for `presence`Godfrey Chan2014-08-291-0/+5
| | | | | | | | | | | | | | | | This was removed by mistake in 5e51bdd
* | | | We tenderized the wrong method! Object#try already had the yield option, ↵David Heinemeier Hansson2014-08-292-10/+4
| | | | | | | | | | | | | | | | just needed some tenderloving instance_eval to fit the bill
* | | | Clarify the origin of this great addition to Rails :trollface: :trollface ↵David Heinemeier Hansson2014-08-291-1/+1
| | | | | | | | | | | | | | | | :trollface:
* | | | Use instance_eval on @tenderlove's suggestion :trollface:David Heinemeier Hansson2014-08-291-2/+2
| | | |
* | | | Added yield to Object#presenceDavid Heinemeier Hansson2014-08-291-0/+5
| |/ / |/| |
* | | Skip #eql? tests on Rubinius for AS::DurationRobin Dupret2014-08-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since Rubinius is relying on #instance_of? for its definition of #eql? (http://git.io/MtmbbA) but ActiveSupport::Duration should behave like is_a? it returns true with `Fixnum`. Thus, for the moment, the last assertion is failing so we have to skip this test.