Class: Metasploit::Model::Spec::I18nExceptionHandler

Inherits:
I18n::ExceptionHandler
  • Object
show all
Defined in:
lib/metasploit/model/spec/i18n_exception_handler.rb

Overview

Raises all I18n errors as exceptions so that missing translations (or other errors) with en.yml are caught by the specs.

end

Examples:

Use in spec_helper.rb to find missing translations

RSpec.configure do |config|
  config.before(:suite) do
    # catch missing translations
    I18n.exception_handler = Metasploit::Model::Spec::I18nExceptionHandler.new
  end

Instance Method Summary collapse

Instance Method Details

#call(exception, locale, key, options) ⇒ void

This method returns an undefined value.

Raises exception.

Raises:

  • (Exception)

16
17
18
# File 'lib/metasploit/model/spec/i18n_exception_handler.rb', line 16

def call(exception, locale, key, options)
  raise exception.to_exception
end