aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/array_inquirer_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-3/+3
|
* [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
|
* It would be safer not to totally undef core classes' respond_to_missing?Akira Matsuda2017-01-151-1/+6
| | | | instead, rewrite them to no-op
* This test wasn't actually an effective regression testAkira Matsuda2017-01-151-4/+5
|
* AS::ArrayInquirer#respond_to_missing? should fallback to superAkira Matsuda2017-01-151-0/+14
| | | | in case Array or any other ancestor class' respond_to_missing? was defined.
* applies new string literal convention in activesupport/testXavier Noria2016-08-061-5/+5
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* ArrayInquirer to correctly find symbols or stringsLeigh Halliday2015-08-281-2/+7
| | | | | | | | | The problem existed where if your ArrayInquirer values were strings but you checked them using any? with a symbol, it would not find the value. Now it will correctly check whether both the String form or the Symbol form are included in the Array. `
* Require the extensions to tests pass in isolationRafael Mendonça França2015-03-301-0/+1
|
* Revert "Remove Array#inquiry"Rafael Mendonça França2015-03-301-0/+7
| | | | | | This reverts commit 9420de59f5b7f5ceac77e28e6c326ec145f71f80. Reason: Turns out we want to keep this method.
* Remove Array#inquiryRafael Mendonça França2015-03-271-7/+0
| | | | | We are promoting too much a feature that will not be widler used. So for now lets keep just the ArrayInquirer constructor.
* Add ActiveSupport::ArrayInquirer and Array#inquiryGeorge Claghorn2015-03-241-0/+35
Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its string-like contents. For example, `request.variant` returns an `ArrayInquirer` object. To check a request's variants, you can call: request.variant.phone? request.variant.any?(:phone, :tablet) ...instead of: request.variant.include?(:phone) request.variant.any? { |v| v.in?([:phone, :tablet]) } `Array#inquiry` is a shortcut for wrapping the receiving array in an `ArrayInquirer`: pets = [:cat, :dog] pets.cat? # => true pets.ferret? # => false pets.any?(:cat, :ferret} # => true