类: RSpec::Matchers::BuiltIn::Compound 私有
- 继承
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::Compound
- 定义于
- lib/rspec/matchers/built_in/compound.rb
概览
此类属于私有 API 的一部分。 应尽可能避免使用此类,因为它可能会在将来被移除或更改。
and
和 or
复合匹配器的基类。
在命名空间下定义
类: And, NestedEvaluator, Or, SequentialEvaluator
常量摘要
从 BaseMatcher 继承的常量
实例方法摘要 折叠
- #description ⇒ String 私有
- #diffable? ⇒ Boolean 私有
- #expected ⇒ RSpec::Matchers::MultiMatcherDiff 私有
- #expects_call_stack_jump? ⇒ Boolean 私有
-
#initialize(matcher_1, matcher_2) ⇒ Compound 构造函数 私有
Compound 的新实例。
- #supports_block_expectations? ⇒ Boolean 私有
- #supports_value_expectations? ⇒ Boolean 私有
从 BaseMatcher 继承的方法
#match_unless_raises, #matches?
从 BaseMatcher::DefaultFailureMessages 包含的方法
#failure_message, #failure_message_when_negated
从 Composable 包含的方法
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
构造函数详情
#initialize(matcher_1, matcher_2) ⇒Compound
此方法属于私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
返回 Compound 的新实例。
10 11 12 13 |
# File 'lib/rspec/matchers/built_in/compound.rb', line 10 def initialize(matcher_1, matcher_2) @matcher_1 = matcher_1 @matcher_2 = matcher_2 end |
实例方法详情
#description ⇒String
此方法属于私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
25 26 27 |
# File 'lib/rspec/matchers/built_in/compound.rb', line 25 def description "#{matcher_1.description} #{conjunction} #{matcher_2.description}" end |
#diffable? ⇒Boolean
此方法属于私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
49 50 51 |
# File 'lib/rspec/matchers/built_in/compound.rb', line 49 def diffable? matcher_is_diffable?(matcher_1) || matcher_is_diffable?(matcher_2) end |
#expected ⇒RSpec::Matchers::MultiMatcherDiff
此方法属于私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
55 56 57 58 |
# File 'lib/rspec/matchers/built_in/compound.rb', line 55 def expected return nil unless evaluator ::RSpec::Matchers::MultiMatcherDiff.for_many_matchers(diffable_matcher_list) end |
#expects_call_stack_jump? ⇒Boolean
此方法属于私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
42 43 44 45 |
# File 'lib/rspec/matchers/built_in/compound.rb', line 42 def expects_call_stack_jump? NestedEvaluator.matcher_expects_call_stack_jump?(matcher_1) || NestedEvaluator.matcher_expects_call_stack_jump?(matcher_2) end |
#supports_block_expectations? ⇒Boolean
此方法属于私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
30 31 32 33 |
# File 'lib/rspec/matchers/built_in/compound.rb', line 30 def supports_block_expectations? matcher_supports_block_expectations?(matcher_1) && matcher_supports_block_expectations?(matcher_2) end |
#supports_value_expectations? ⇒Boolean
此方法属于私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
36 37 38 39 |
# File 'lib/rspec/matchers/built_in/compound.rb', line 36 def supports_value_expectations? matcher_supports_value_expectations?(matcher_1) && matcher_supports_value_expectations?(matcher_2) end |