模块: RSpec::Matchers::FailMatchers
- 定义于
- lib/rspec/matchers/fail_matchers.rb
概述
实例方法摘要 折叠
-
#fail(&block) ⇒ Object
如果期望失败则匹配。
-
#fail_including(*snippets) ⇒ Object
如果期望失败包括提供的消息则匹配。
-
#fail_with(message) ⇒ Object
如果期望失败并使用提供的消息则匹配。
实例方法详情
#fail(&block) ⇒Object
如果期望失败则匹配
17 18 19 |
# File 'lib/rspec/matchers/fail_matchers.rb', line 17 def fail(&block) raise_error(RSpec::Expectations::ExpectationNotMetError, &block) end |
#fail_including(*snippets) ⇒Object
如果期望失败包括提供的消息则匹配
34 35 36 37 38 39 |
# File 'lib/rspec/matchers/fail_matchers.rb', line 34 def fail_including(*snippets) raise_error( RSpec::Expectations::ExpectationNotMetError, a_string_including(*snippets) ) end |
#fail_with(message) ⇒Object
如果期望失败并使用提供的消息则匹配
26 27 28 |
# File 'lib/rspec/matchers/fail_matchers.rb', line 26 def fail_with() raise_error(RSpec::Expectations::ExpectationNotMetError, ) end |