类: RSpec::Matchers::BuiltIn::Satisfy 私有

继承
BaseMatcher 显示全部
定义在
lib/rspec/matchers/built_in/satisfy.rb

概述

此类是私有 API 的一部分。 应尽可能避免使用此类,因为它可能在将来被删除或更改。

satisfy 提供实现。不打算直接实例化。

常量摘要

BaseMatcher 继承的常量

BaseMatcher::UNDEFINED

实例方法摘要 折叠

BaseMatcher 继承的方法

#diffable?, #expects_call_stack_jump?, #match_unless_raises, #supports_block_expectations?

Composable 包含的方法

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

构造函数详情

#initialize(description = nil, &block) ⇒Satisfy

此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它可能在将来被删除或更改。

返回一个新的 Satisfy 实例。

8
9
10
11
# File 'lib/rspec/matchers/built_in/satisfy.rb', line 8
def initialize(description=nil, &block)
  @description = description
  @block = block
end

实例方法详情

#failure_messageString

此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它可能在将来被删除或更改。

返回

  • (String)
27
28
29
# File 'lib/rspec/matchers/built_in/satisfy.rb', line 27
def failure_message
  "expected #{actual_formatted} to #{description}"
end

#failure_message_when_negatedString

此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它可能在将来被删除或更改。

返回

  • (String)
33
34
35
# File 'lib/rspec/matchers/built_in/satisfy.rb', line 33
def failure_message_when_negated
  "expected #{actual_formatted} not to #{description}"
end