class RSpec::Rails::Matchers::ActionCable::HaveBroadcastedTo
def check(messages)
def check(messages) @matching_msgs, @unmatching_msgs = messages.partition do |msg| decoded = ActiveSupport::JSON.decode(msg) decoded = decoded.with_indifferent_access if decoded.is_a?(Hash) if @data.nil? || values_match?(@data, decoded) @block.call(decoded) true else false end end @matching_msgs_count = @matching_msgs.size case @expectation_type when :exactly then @expected_number == @matching_msgs_count when :at_most then @expected_number >= @matching_msgs_count when :at_least then @expected_number <= @matching_msgs_count end end