Method: OSpec::RaiseErrorMatcher#match

Defined in:
lib/ospec/matchers.rb

#match(block) ⇒ Object



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/ospec/matchers.rb', line 77

def match block
  should_raise = false
  begin
    block.call
    should_raise = true
  rescue => e
  end

  if should_raise
    failure "expected #{@actual} to be raised, but nothing was."
  end
end