aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object/inclusion_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add test cases for #in? and #presence_inAkshay Vishnoi2014-06-111-0/+4
|
* 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
|
* 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
* use AS::TestCase as the base classAaron Patterson2012-01-051-1/+1
|
* Object#in? also accepts multiple parametersTadas Tamošauskas2011-11-261-0/+10
|
* 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.