类: RSpec::Matchers::BuiltIn::ContainExactly 私有
- 继承
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::ContainExactly
- 定义于
- lib/rspec/matchers/built_in/contain_exactly.rb
概述
此类是私有 API 的一部分。 应尽可能避免使用此类,因为它将来可能会被移除或更改。
rubocop:disable Metrics/ClassLength 提供了 contain_exactly
和 match_array
的实现。不打算直接实例化。
常量摘要
从 BaseMatcher 继承的常量
实例方法摘要 折叠
- #description ⇒ String 私有
- #failure_message ⇒ String 私有
- #failure_message_when_negated ⇒ String 私有
- #matches?(actual) ⇒ Boolean 私有
从 BaseMatcher 继承的方法
#diffable?, #expects_call_stack_jump?, #initialize, #match_unless_raises, #supports_block_expectations?
从 Composable 包含的方法
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
构造函数详情
此类从 RSpec::Matchers::BuiltIn::BaseMatcher 继承了一个构造函数
实例方法详情
#description ⇒String
此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它将来可能会被移除或更改。
29 30 31 32 |
# File 'lib/rspec/matchers/built_in/contain_exactly.rb', line 29 def description list = EnglishPhrasing.list(surface_descriptions_in(expected)) "contain exactly#{list}" end |
#failure_message ⇒String
此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它将来可能会被移除或更改。
11 12 13 14 15 16 17 18 |
# File 'lib/rspec/matchers/built_in/contain_exactly.rb', line 11 def if Array === actual else "expected a collection that can be converted to an array with " \ "`#to_ary` or `#to_a`, but got #{actual_formatted}" end end |
#failure_message_when_negated ⇒String
此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它将来可能会被移除或更改。
22 23 24 25 |
# File 'lib/rspec/matchers/built_in/contain_exactly.rb', line 22 def list = EnglishPhrasing.list(surface_descriptions_in(expected)) "expected #{actual_formatted} not to contain exactly#{list}" end |
#matches?(actual) ⇒Boolean
此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它将来可能会被移除或更改。
34 35 36 37 38 39 40 |
# File 'lib/rspec/matchers/built_in/contain_exactly.rb', line 34 def matches?(actual) @pairings_maximizer = nil @best_solution = nil @extra_items = nil @missing_items = nil super(actual) end |