Skip to content

Commit 014b9f8

Browse files
authored
Merge pull request #2270 from rspec/fix-deprecation-warning-in-have_broadcasted_to-matcher
Fix Ruby 2.7 deprecation in have_broadcasted_to
2 parents 8b2b8ff + ac13406 commit 014b9f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def initialize(target, channel:)
1313
set_expected_number(:exactly, 1)
1414
end
1515

16-
def with(data = nil)
16+
def with(data = nil, &block)
1717
@data = data
1818
@data = @data.with_indifferent_access if @data.is_a?(Hash)
19-
@block = Proc.new if block_given?
19+
@block = block if block
2020
self
2121
end
2222

0 commit comments

Comments
 (0)