Class: RSpec::Matchers::BuiltIn::YieldWithNoArgs Private

Inherits:
BaseMatcher show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/yield.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 ‘yield_with_no_args`. Not intended to be instantiated directly.

Constant Summary

Constants inherited from BaseMatcher

BaseMatcher::UNDEFINED

Instance Attribute Summary

Attributes inherited from BaseMatcher

#actual, #expected, #matcher_name, #rescued_exception

Instance Method Summary collapse

Methods inherited from BaseMatcher

#actual_formatted, #description, #diffable?, #expected_formatted, #expects_call_stack_jump?, #initialize, #match_unless_raises, matcher_name

Methods included from BaseMatcher::DefaultFailureMessages

has_default_failure_messages?

Methods included from BaseMatcher::HashFormatting

improve_hash_formatting

Methods included from Composable

#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?

Constructor Details

This class inherits a constructor from RSpec::Matchers::BuiltIn::BaseMatcher

Instance Method Details

#does_not_match?(block) ⇒ 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)


158
159
160
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/yield.rb', line 158

def does_not_match?(block)
  !matches?(block) && @probe.has_block?
end

#failure_messageObject

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.



163
164
165
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/yield.rb', line 163

def failure_message
  "expected given block to yield with no arguments, but #{positive_failure_reason}"
end

#failure_message_when_negatedObject

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.



168
169
170
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/yield.rb', line 168

def failure_message_when_negated
  "expected given block not to yield with no arguments, but #{negative_failure_reason}"
end

#matches?(block) ⇒ 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)


151
152
153
154
155
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/yield.rb', line 151

def matches?(block)
  @probe = YieldProbe.probe(block)
  return false unless @probe.has_block?
  @probe.yielded_once?(:yield_with_no_args) && @probe.single_yield_args.empty?
end

#supports_block_expectations?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)


173
174
175
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/yield.rb', line 173

def supports_block_expectations?
  true
end

#supports_value_expectations?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)


178
179
180
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/matchers/built_in/yield.rb', line 178

def supports_value_expectations?
  false
end