Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

docs: Add example of proc being acceptable as filter in config.include #3112

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use proc
JonRowe authored Sep 11, 2024

Verified

This commit was signed with the committer’s verified signature.
zeramorphic Sky Wilshaw
commit 86a12b73ba61bd6a5cc097d6ca7ad89c387aa0fc
2 changes: 1 addition & 1 deletion lib/rspec/core/configuration.rb
Original file line number Diff line number Diff line change
@@ -1411,7 +1411,7 @@ def exclusion_filter
# config.include(AuthenticationHelpers, :type => :request)
#
# # included in examples where the `:type` metadata matches a proc condition
# config.include(AuthenticationHelpers, :type => ->(type, _metadata) { [:request, :controller].include?(type) })
# config.include(AuthenticationHelpers, :type => proc { |type, _metadata| [:request, :controller].include?(type) })
# end
#
# describe "edit profile", :preferences, :type => :request do