class ChefSpec::ExpectException

def exception_matched?

def exception_matched?
  @formatter_exception == @matcher.last_error_for_chefspec ||
    @matcher.last_error_for_chefspec === @formatter_exception
end

def expected?

def expected?
  return false if @matcher.nil?
  exception_matched? && message_matched?
end

def initialize(formatter_exception, formatter_message = nil)

def initialize(formatter_exception, formatter_message = nil)
  @formatter_exception = formatter_exception
  @formatter_message   = formatter_message
  @matcher             = RSpec::Matchers::BuiltIn::RaiseError.last_run
end

def message_matched?

def message_matched?
  case @formatter_message
  when nil
    true
  when Regexp
    @matcher.expected_message =~ @formatter_message
  else
    @matcher.expected_message == @formatter_message
  end
end