Skip to content

Test ArrayInquirer#any? without candidates - #57543

Merged
rafaelfranca merged 1 commit into
rails:mainfrom
hammadxcm:test-array-inquirer-any-no-args
Jun 2, 2026
Merged

rafaelfranca merged 1 commit into
rails:mainfrom
hammadxcm:test-array-inquirer-any-no-args

Conversation

@hammadxcm

Copy link
Copy Markdown
Contributor

ActiveSupport::ArrayInquirer#any? documents that, when called with no candidates, it returns whether the array has any elements (delegating to Array#any?):

variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet])
variants.any? # => true

Only the with-candidates and with-block forms were tested. This adds coverage for the no-argument case (true for a populated inquirer, false for an empty one). No production code changes — test-only.

ArrayInquirer#any? documents that calling it with no candidates
returns whether the array has any elements (delegating to Array#any?),
but only the with-candidates and with-block forms were tested.

Add coverage for the no-argument case.
@rafaelfranca
rafaelfranca merged commit 382d9e7 into rails:main Jun 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants