Sha256: f476a6e5ce652c5bf5d900a73e977c214f3c89d1a0f3aab4161710d0aae9a74c

Contents?: true

Size: 655 Bytes

Versions: 8

Compression:

Stored size: 655 Bytes

Contents

require 'metasploit/model/spec'

# Raises all I18n errors as exceptions so that missing translations (or other errors) with en.yml are caught by the
# specs.
#
# @example 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
#  end
class Metasploit::Model::Spec::I18nExceptionHandler < I18n::ExceptionHandler
  # Raises `exception`.
  #
  # @return [void]
  # @raise [Exception]
  def call(exception, locale, key, options)
    raise exception.to_exception
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metasploit-model-0.27.3 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-0.27.3-java lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-0.27.2 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-0.27.2-java lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-0.27.1 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-0.27.1-java lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-0.27.0 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-0.27.0-java lib/metasploit/model/spec/i18n_exception_handler.rb