Sha256: c1f5657b7b24183b29983ae0142d119cd6a7be123690ee8354c8e208a59ecc11

Contents?: true

Size: 622 Bytes

Versions: 60

Compression:

Stored size: 622 Bytes

Contents

# 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

60 entries across 60 versions & 1 rubygems

Version Path
metasploit-model-5.0.2 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-5.0.1 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-5.0.0 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-4.0.6 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-4.0.5 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-4.0.4 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-4.0.3 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-4.0.2 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-4.0.1 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-4.0.0 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-3.1.4 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-3.1.3 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-3.1.2 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-3.1.1 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-3.1.0 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-3.0.0 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-2.0.4 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-2.0.3 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-2.0.2 lib/metasploit/model/spec/i18n_exception_handler.rb
metasploit-model-2.0.1 lib/metasploit/model/spec/i18n_exception_handler.rb