模块:RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages 私有
- 定义于
- lib/rspec/matchers/built_in/base_matcher.rb
概述
此模块是私有 API 的一部分。 应尽量避免使用此模块,因为它可能在将来被移除或更改。
提供基于 description
的默认失败消息实现。
实例方法摘要 折叠
-
#failure_message ⇒ String 私有
提供良好的通用失败消息。
-
#failure_message_when_negated ⇒ String 私有
提供良好的通用否定失败消息。
实例方法详细信息
#failure_message ⇒String
此方法是私有 API 的一部分。 应尽量避免使用此方法,因为它可能在将来被移除或更改。
提供良好的通用失败消息。基于 description
。在子类化时,如果对该失败消息不满意,通常只需要重写 description
。
213 214 215 |
# File 'lib/rspec/matchers/built_in/base_matcher.rb', line 213 def "expected #{description_of @actual} to #{description}".dup end |
#failure_message_when_negated ⇒String
此方法是私有 API 的一部分。 应尽量避免使用此方法,因为它可能在将来被移除或更改。
提供良好的通用否定失败消息。基于 description
。在子类化时,如果对该失败消息不满意,通常只需要重写 description
。
222 223 224 |
# File 'lib/rspec/matchers/built_in/base_matcher.rb', line 222 def "expected #{description_of @actual} not to #{description}".dup end |