Sha256: 1d53926ad1ed2beb460917345561436941aebc19a17ca33f2f0fafd81c2f6930

Contents?: true

Size: 544 Bytes

Versions: 4

Compression:

Stored size: 544 Bytes

Contents

# frozen_string_literal: true

require "cases/helper"

class ErrorsTest < ActiveRecord::TestCase
  def test_can_be_instantiated_with_no_args
    base = ActiveRecord::ActiveRecordError
    error_klasses = ObjectSpace.each_object(Class).select { |klass| klass < base }

    (error_klasses - [ActiveRecord::AmbiguousSourceReflectionForThroughAssociation]).each do |error_klass|
      error_klass.new.inspect
    rescue ArgumentError
      raise "Instance of #{error_klass} can't be initialized with no arguments"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 test/cases/errors_test.rb
ibm_db-5.4.1-x86-mingw32 test/cases/errors_test.rb
ibm_db-5.4.0-x86-mingw32 test/cases/errors_test.rb
ibm_db-5.3.2-x86-mingw32 test/cases/errors_test.rb