Class: RSpec::Rails::Matchers::ActionCable::HaveStream Private

Inherits:
Matchers::BuiltIn::BaseMatcher
  • Object
show all
Defined in:
lib/rspec/rails/matchers/action_cable/have_streams.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Provides the implementation for ‘have_stream`, `have_stream_for`, and `have_stream_from`. Not intended to be instantiated directly.

Instance Method Summary collapse

Instance Method Details

#does_not_match?(subscription) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


33
34
35
# File 'lib/rspec/rails/matchers/action_cable/have_streams.rb', line 33

def does_not_match?(subscription)
  !match(subscription)
end

#failure_messageString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


13
14
15
# File 'lib/rspec/rails/matchers/action_cable/have_streams.rb', line 13

def failure_message
  "expected to have #{base_message}"
end

#failure_message_when_negatedString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


19
20
21
# File 'lib/rspec/rails/matchers/action_cable/have_streams.rb', line 19

def failure_message_when_negated
  "expected not to have #{base_message}"
end

#matches?(subscription) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Raises:

  • (ArgumentError)


25
26
27
28
29
# File 'lib/rspec/rails/matchers/action_cable/have_streams.rb', line 25

def matches?(subscription)
  raise(ArgumentError, "have_streams is used for negated expectations only") if no_expected?

  match(subscription)
end