类: RSpec::Matchers::BuiltIn::All 私有
- 继承
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::All
- 定义于
- lib/rspec/matchers/built_in/all.rb
概述
此类是私有 API 的一部分。 如果可能,请避免使用此类,因为它可能会在将来被移除或更改。
提供 all
的实现。不打算直接实例化。
常量摘要
从 BaseMatcher 继承的常量
实例方法摘要 折叠
- #description ⇒ String 私有
- #failure_message ⇒ String 私有
-
#initialize(matcher) ⇒ All 构造函数 私有
All 的新实例。
从 BaseMatcher 继承的方法
#diffable?, #expects_call_stack_jump?, #match_unless_raises, #matches?, #supports_block_expectations?
从 BaseMatcher::DefaultFailureMessages 包含的方法
从 Composable 包含的方法
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
构造函数详情
#initialize(matcher) ⇒All
此方法是私有 API 的一部分。 如果可能,请避免使用此方法,因为它可能会在将来被移除或更改。
返回 All 的新实例。
11 12 13 14 |
# File 'lib/rspec/matchers/built_in/all.rb', line 11 def initialize(matcher) @matcher = matcher @failed_objects = {} end |
实例方法详情
#description ⇒String
此方法是私有 API 的一部分。 如果可能,请避免使用此方法,因为它可能会在将来被移除或更改。
37 38 39 |
# File 'lib/rspec/matchers/built_in/all.rb', line 37 def description improve_hash_formatting "all #{description_of matcher}" end |
#failure_message ⇒String
此方法是私有 API 的一部分。 如果可能,请避免使用此方法,因为它可能会在将来被移除或更改。
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rspec/matchers/built_in/all.rb', line 23 def unless iterable? return "#{improve_hash_formatting(super)}, but was not iterable" end = [improve_hash_formatting(super)] failed_objects.each do |index, | << (index, ) end .join("\n\n") end |