Sha256: 9b57d423be93f882cd0b84278ba2bca1ec0f99b7f9db85d07321a4a27a3903cf

Contents?: true

Size: 525 Bytes

Versions: 25

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

module ActiveSupport
  module Testing
    # Warns when a test case does not perform any assertions.
    #
    # This is helpful in detecting broken tests that do not perform intended assertions.
    module TestsWithoutAssertions # :nodoc:
      def after_teardown
        super

        if assertions.zero? && !skipped? && !error?
          file, line = method(name).source_location
          warn "Test is missing assertions: `#{name}` #{file}:#{line}"
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
activesupport-8.0.2 lib/active_support/testing/tests_without_assertions.rb
tailscale_middleware-0.0.3 vendor/cache/ruby/3.4.0/gems/activesupport-8.0.1/lib/active_support/testing/tests_without_assertions.rb
activesupport-8.0.1 lib/active_support/testing/tests_without_assertions.rb
activesupport-8.0.0.1 lib/active_support/testing/tests_without_assertions.rb
activesupport-7.2.2.1 lib/active_support/testing/tests_without_assertions.rb
activesupport-8.0.0 lib/active_support/testing/tests_without_assertions.rb
activesupport-7.2.2 lib/active_support/testing/tests_without_assertions.rb
activesupport-8.0.0.rc2 lib/active_support/testing/tests_without_assertions.rb
activesupport-7.2.1.2 lib/active_support/testing/tests_without_assertions.rb
activesupport-8.0.0.rc1 lib/active_support/testing/tests_without_assertions.rb
activesupport-7.2.1.1 lib/active_support/testing/tests_without_assertions.rb
activesupport-8.0.0.beta1 lib/active_support/testing/tests_without_assertions.rb
omg-activesupport-8.0.0.alpha9 lib/active_support/testing/tests_without_assertions.rb
omg-activesupport-8.0.0.alpha8 lib/active_support/testing/tests_without_assertions.rb
omg-activesupport-8.0.0.alpha7 lib/active_support/testing/tests_without_assertions.rb
omg-activesupport-8.0.0.alpha4 lib/active_support/testing/tests_without_assertions.rb
omg-activesupport-8.0.0.alpha3 lib/active_support/testing/tests_without_assertions.rb
omg-activesupport-8.0.0.alpha2 lib/active_support/testing/tests_without_assertions.rb
omg-activesupport-8.0.0.alpha1 lib/active_support/testing/tests_without_assertions.rb
activesupport-7.2.1 lib/active_support/testing/tests_without_assertions.rb