类: RSpec::Matchers::BuiltIn::Eq 私有
- 继承
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::Eq
- 定义在
- lib/rspec/matchers/built_in/eq.rb
概述
此类是私有 API 的一部分。 应尽可能避免使用此类,因为它可能会在将来被移除或更改。
为 eq
提供实现。不建议直接实例化。
常量摘要
从 BaseMatcher 继承的常量
实例方法摘要 折叠
- #description ⇒ String 私有
- #diffable? ⇒ Boolean 私有
- #failure_message ⇒ String 私有
- #failure_message_when_negated ⇒ String 私有
从 BaseMatcher 继承的方法
#expects_call_stack_jump?, #initialize, #match_unless_raises, #matches?, #supports_block_expectations?
从 Composable 包含的方法
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
构造函数详情
此类从 RSpec::Matchers::BuiltIn::BaseMatcher 继承了一个构造函数
实例方法详情
#description ⇒String
此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
26 27 28 |
# File 'lib/rspec/matchers/built_in/eq.rb', line 26 def description "eq #{expected_formatted}" end |
#diffable? ⇒Boolean
此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
32 33 34 |
# File 'lib/rspec/matchers/built_in/eq.rb', line 32 def diffable? true end |
#failure_message ⇒String
此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
10 11 12 13 14 15 16 |
# File 'lib/rspec/matchers/built_in/eq.rb', line 10 def if string_encoding_differs? "\nexpected: #{format_encoding(expected)} #{expected_formatted}\n got: #{format_encoding(actual)} #{actual_formatted}\n\n(compared using ==)\n" else "\nexpected: #{expected_formatted}\n got: #{actual_formatted}\n\n(compared using ==)\n" end end |
#failure_message_when_negated ⇒String
此方法是私有 API 的一部分。 应尽可能避免使用此方法,因为它可能会在将来被移除或更改。
20 21 22 |
# File 'lib/rspec/matchers/built_in/eq.rb', line 20 def "\nexpected: value != #{expected_formatted}\n got: #{actual_formatted}\n\n(compared using ==)\n" end |