类: RSpec::Matchers::BuiltIn::Compound::And

继承
RSpec::Matchers::BuiltIn::Compound 显示全部
定义于
lib/rspec/matchers/built_in/compound.rb

概述

用于表示复合 and 预期的匹配器。

常量摘要

BaseMatcher 继承的常量

BaseMatcher::UNDEFINED

实例方法摘要 折叠

RSpec::Matchers::BuiltIn::Compound 继承的方法

#description, #diffable?, #expected, #expects_call_stack_jump?, #initialize, #supports_block_expectations?, #supports_value_expectations?

BaseMatcher 继承的方法

#description, #diffable?, #expects_call_stack_jump?, #initialize, #match_unless_raises, #matches?, #supports_block_expectations?

BaseMatcher::DefaultFailureMessages 包含的方法

#failure_message_when_negated

Composable 包含的方法

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

构造函数细节

此类从 RSpec::Matchers::BuiltIn::Compound 继承了构造函数

实例方法细节

#failure_messageString

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

返回值

  • (String)
245
246
247
248
249
250
251
252
253
# File 'lib/rspec/matchers/built_in/compound.rb', line 245
def failure_message
  if matcher_1_matches?
    matcher_2.failure_message
  elsif matcher_2_matches?
    matcher_1.failure_message
  else
    compound_failure_message
  end
end