类: RSpec::Matchers::BuiltIn::ThrowSymbol 私有
- 继承
-
Object
- Object
- RSpec::Matchers::BuiltIn::ThrowSymbol
- 包含
- Composable
- 定义于
- lib/rspec/matchers/built_in/throw_symbol.rb
概述
此类是私有 API 的一部分。 尽可能避免使用此类,因为它可能在未来被移除或更改。
提供 throw_symbol
的实现。不打算直接实例化。
实例方法摘要 折叠
- #description ⇒ String 私有
-
#does_not_match?(given_proc) ⇒ Boolean 私有
rubocop:enable Metrics/MethodLength.
- #expects_call_stack_jump? ⇒ Boolean 私有
- #failure_message ⇒ String 私有
- #failure_message_when_negated ⇒ String 私有
-
#initialize(expected_symbol = nil, expected_arg = nil) ⇒ ThrowSymbol 构造函数 私有
ThrowSymbol 的新实例。
-
#supports_block_expectations? ⇒ True 私有
指示此匹配器匹配块。
- #supports_value_expectations? ⇒ Boolean 私有
从 Composable 包含的方法
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
构造函数详情
#initialize(expected_symbol = nil, expected_arg = nil) ⇒ThrowSymbol
此方法是私有 API 的一部分。 尽可能避免使用此方法,因为它可能在未来被移除或更改。
返回 ThrowSymbol 的新实例。
10 11 12 13 14 |
# File 'lib/rspec/matchers/built_in/throw_symbol.rb', line 10 def initialize(expected_symbol=nil, expected_arg=nil) @expected_symbol = expected_symbol @expected_arg = expected_arg @caught_symbol = @caught_arg = nil end |
实例方法详情
#description ⇒String
此方法是私有 API 的一部分。 尽可能避免使用此方法,因为它可能在未来被移除或更改。
86 87 88 |
# File 'lib/rspec/matchers/built_in/throw_symbol.rb', line 86 def description "throw #{expected}" end |
#does_not_match?(given_proc) ⇒Boolean
此方法是私有 API 的一部分。 尽可能避免使用此方法,因为它可能在未来被移除或更改。
rubocop:enable Metrics/MethodLength
68 69 70 |
# File 'lib/rspec/matchers/built_in/throw_symbol.rb', line 68 def does_not_match?(given_proc) !matches?(given_proc) && Proc === given_proc end |
#expects_call_stack_jump? ⇒Boolean
此方法是私有 API 的一部分。 尽可能避免使用此方法,因为它可能在未来被移除或更改。
103 104 105 |
# File 'lib/rspec/matchers/built_in/throw_symbol.rb', line 103 def expects_call_stack_jump? true end |
#failure_message ⇒String
此方法是私有 API 的一部分。 尽可能避免使用此方法,因为它可能在未来被移除或更改。
74 75 76 |
# File 'lib/rspec/matchers/built_in/throw_symbol.rb', line 74 def "expected #{expected} to be thrown, #{actual_result}" end |
#failure_message_when_negated ⇒String
此方法是私有 API 的一部分。 尽可能避免使用此方法,因为它可能在未来被移除或更改。
80 81 82 |
# File 'lib/rspec/matchers/built_in/throw_symbol.rb', line 80 def "expected #{expected('no Symbol')}#{' not' if @expected_symbol} to be thrown, #{actual_result}" end |
#supports_block_expectations? ⇒True
此方法是私有 API 的一部分。 尽可能避免使用此方法,因为它可能在未来被移除或更改。
指示此匹配器匹配块。
93 94 95 |
# File 'lib/rspec/matchers/built_in/throw_symbol.rb', line 93 def supports_block_expectations? true end |
#supports_value_expectations? ⇒Boolean
此方法是私有 API 的一部分。 尽可能避免使用此方法,因为它可能在未来被移除或更改。
98 99 100 |
# File 'lib/rspec/matchers/built_in/throw_symbol.rb', line 98 def supports_value_expectations? false end |