aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object
Commit message (Collapse)AuthorAgeFilesLines
* add implementation of respond_to? for ActiveSupport::Durationlsylvester2014-09-151-1/+1
|
* 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
|
* Rename tests tooRafael Mendonça França2014-08-011-2/+2
|
* Rename Object#self to Object#itself to have parity with matz sanctioned ↵David Heinemeier Hansson2014-08-011-1/+1
| | | | method name for Ruby 2.2
* Added Object#self which returns the object itselfDavid Heinemeier Hansson2014-08-011-0/+9
|
* Add missing test case for Array#to_sentence, collect all test cases for ↵Akshay Vishnoi2014-07-291-2/+8
| | | | Object#to_param at one place and avoid repitition
* Added failing test case for #16131Godfrey Chan2014-07-291-0/+42
|
* Merge pull request #15629 from akshay-vishnoi/test-to_paramRafael Mendonça França2014-07-282-0/+22
|\ | | | | Define Hash#to_query and set Hash#to_param as alias to it; with test cases
| * Move to_param to to_query, also Improve testsAkshay Vishnoi2014-06-202-0/+22
| |
* | Move object test files under objectAkshay Vishnoi2014-07-293-0/+155
| |
* | missing activesupport test coverageEugene Gilburg2014-07-191-0/+4
| |
* | Move test for blank.rb under objectAkshay Vishnoi2014-06-111-0/+36
| |
* | Add test cases for #in? and #presence_inAkshay Vishnoi2014-06-111-0/+4
|/
* Merge pull request #14949 from bogdan/empty-hash-array-parameterizationRafael Mendonça França2014-05-041-3/+5
|\ | | | | [Fixes #14948] Hash#to_query: right serialization for empty hash and array
| * [Fixes #14948] Hash#to_query: Changed a way how empty hash and empty array ↵Bogdan Gusiev2014-05-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | are serialized Empty Hash or Array should not present in serialization result {a: []}.to_query # => "" {a: {}}.to_query # => "" For more info see #14948.
* | Remove deprecated file(`active_support/core_ext/object/to_json.rb`) and its ↵Kuldeep Aggarwal2014-05-041-9/+0
|/ | | | test case.
* Object#duplicable?Akshay Vishnoi2014-04-161-16/+9
| | | | | | 1. Improve tests 2. Remove unnecessary constant 3. Add docs for BigDecimal#duplicable?
* Move tests for deep_dup and duplicable to object directoryAkshay Vishnoi2014-04-132-0/+91
|
* Go with #presence_in instead of #present_in -- it doesnt sound quite as ↵David Heinemeier Hansson2014-02-241-3/+3
| | | | good, but the closer relationship to #presence over #present is ultimately worth it
* Use assert_nil instead as its clearer about what the return is expected to beDavid Heinemeier Hansson2014-02-181-1/+1
|
* Added Object#present_in to simplify value whitelistingDavid Heinemeier Hansson2014-02-181-0/+5
|
* Fix to_query with empty arrays tooRafael Mendonça França2014-02-061-0/+2
|
* Refatoring the method to avoid shot-circuit returnRafael Mendonça França2014-02-051-0/+2
|
* Test with a blank valueRafael Mendonça França2014-02-051-2/+2
|
* Move test to the right fileRafael Mendonça França2014-02-052-11/+9
|
* Fixed "Hash#to_param confused by empty hash values #13892"Hincu Petru2014-02-051-0/+11
|
* Moved all JSON core extensions into core_ext/object/jsonGodfrey Chan2013-09-131-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TL;DR The primary driver is to remove autoload surprise. This is related to #12106. (The root cause for that ticket is that json/add defines Regexp#to_json among others, but here I'll reproduce the problem without json/add.) Before: >> require 'active_support/core_ext/to_json' => true >> //.as_json NoMethodError: undefined method `as_json' for //:Regexp from (irb):3 from /Users/godfrey/.rvm/rubies/ruby-2.0.0-p195/bin/irb:16:in `<main>' >> //.to_json => "\"(?-mix:)\"" >> //.as_json => "(?-mix:)" After: >> require 'active_support/core_ext/to_json' => true >> //.as_json => "(?-mix:)" This is because ActiveSupport::JSON is autoloaded the first time Object#to_json is called, which causes additional core extentions (previously defined in active_support/json/encoding.rb) to be loaded. When someone require 'active_support/core_ext', the expectation is that it would add certain methods to the core classes NOW. The previous behaviour causes additional methods to be loaded the first time you call `to_json`, which could cause nasty surprises and other unplesant side-effects. This change moves all core extensions in to core_ext/json. AS::JSON is still autoloaded on first #to_json call, but since it nolonger include the core extensions, it should address the aforementioned bug. *Requiring core_ext/object/to_json now causes a deprecation warnning*
* Revert "Object#in? also accepts multiple parameters"Brian Morearty2013-05-011-10/+0
| | | | | | | | | | | | | | | | | | This reverts commit ebf69ab1636df74c76332c53bcd3d8494fb91b45. `in?` must not take multiple parameters because its behavior would be ambiguous: # Test if "B" is included in a list of names with `"B".in?(*names)`: names = ["BMorearty"] "B".in?(*names) # => true names = ["BMorearty","rubyduo"] "B".in?(*names) # => false Conflicts: activesupport/lib/active_support/core_ext/object/inclusion.rb activesupport/test/core_ext/object/inclusion_test.rb
* remove unused parameter passed to assert_query_equal methodVipul A M2013-03-171-1/+1
|
* Remove .rb from require sentencesJosé Corcuera Z2012-09-211-1/+1
|
* remove usages of AS::OrderedHashVishnu Atrai2012-03-031-2/+2
|
* use AS::TestCase as the base classAaron Patterson2012-01-053-3/+3
|
* Object#in? also accepts multiple parametersTadas Tamošauskas2011-11-261-0/+10
|
* Fix Hash#to_query edge case with html_safe string on 1.8 rubybrainopia2011-09-161-0/+9
|
* Revert all the stuff to do with disallowing non-public methods for ↵Jon Leighton2011-08-251-117/+0
| | | | Module#delegate
* Backport Object#public_send to 1.8 so that we can implement Module#delegate ↵Jon Leighton2011-08-151-0/+117
| | | | such that non-public methods raise
* Only rescue a thrown NoMethodError, don't preemptively check for #include?; ↵Jared McFarland2011-04-151-0/+4
| | | | added tests
* Remove `#among?` from Active SupportPrem Sichanugrist2011-04-131-6/+0
| | | | | | After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now. It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
* Update test name to the corresponding method nameSebastian Martinez2011-04-121-1/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Change Object#either? to Object#among? -- thanks to @jamesarosen for the ↵David Heinemeier Hansson2011-04-121-3/+3
| | | | suggestion!
* Add support for Object#in? and Object#either? in Active Support [#6321 ↵Prem Sichanugrist, Brian Morearty, John Reitano2011-04-111-0/+52
| | | | | | | | | | | | state:committed] This will allow you to check if an object is included in another object or the list of objects or not. This patch is derived from patch by Brian Morearty and John Reitano on Lighthouse ticket. I've rewrite it and make sure that we support both 'another object' and 'list of objects' version, as it surely be useful to support both.
* Revert "Quick fix for not escaping []s (not ideal)"Santiago Pastorino2010-11-181-4/+4
| | | | | | | | | According to http://www.ietf.org/rfc/rfc2616.txt and http://tools.ietf.org/rfc/rfc3986.txt [ and ] are reserved characters and should be escaped using "%" HEX HEX This reverts commit 856d2fd874d72dd9f83204affff4edfef3308361 and 1ee9b40b18a0bed5bb10a0785f7e2730bac983f6..
* These tests are trusting in the order of the elements so use OrderedHash ↵Santiago Pastorino2010-07-211-2/+3
| | | | instead of Hash
* Failing tests for to_param/to_query not escaping "[]"Joshua Peek2009-12-021-4/+4
|
* Consolidate Object#to_param and #to_query core extensionsJeremy Kemper2009-11-022-0/+62