Skip to content

Commit

Permalink
Move minitest from rbs/stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Feb 2, 2025
1 parent 18ebd76 commit ce6971e
Show file tree
Hide file tree
Showing 40 changed files with 2,258 additions and 0 deletions.
19 changes: 19 additions & 0 deletions gems/minitest/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This configuration inherits from /.rubocop.yml.
# You can configure RBS style of this gem.
# This file is used on CI. It is configured to automatically
# make rubocop suggestions on pull requests for this gem.
# If you do not like the style enforcement, you should remove this file.
inherit_from: ../../.rubocop.yml

##
# If you want to customize the style, please consult with the gem reviewers.
# You can see the list of cops at https://github.com/ksss/rubocop-on-rbs/blob/main/docs/modules/ROOT/pages/cops.adoc

RBS/Layout:
Enabled: true

RBS/Lint:
Enabled: true

RBS/Style:
Enabled: true
11 changes: 11 additions & 0 deletions gems/minitest/5.25/_test/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Write Ruby code to test the RBS.
# It is type checked by `steep check` command.

require "minitest"

Minitest.clock_time
Minitest.filter_backtrace(caller)
Minitest.process_args
Minitest.load_plugins
Minitest.init_plugins({})
Minitest.after_run do end
115 changes: 115 additions & 0 deletions gems/minitest/5.25/minitest.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# <!-- rdoc-file=lib/minitest.rb -->
# The top-level namespace for Minitest. Also the location of the main runtime.
# See `Minitest.run` for more information.
#
module Minitest
@@installed_at_exit: untyped

@@after_run: untyped

self.@extensions: untyped

def self.cattr_accessor: (untyped name) -> untyped

# <!--
# rdoc-file=lib/minitest.rb
# - autorun()
# -->
# Registers Minitest to run at process exit
#
def self.autorun: () -> untyped

# <!--
# rdoc-file=lib/minitest.rb
# - after_run(&block)
# -->
# A simple hook allowing you to run a block of code after everything is done
# running. Eg:
#
# Minitest.after_run { p $debugging_info }
#
def self.after_run: () { (?) -> untyped } -> untyped

# <!--
# rdoc-file=lib/minitest.rb
# - register_plugin(name_or_mod)
# -->
# Register a plugin to be used. Does NOT require / load it.
#
def self.register_plugin: (untyped name_or_mod) -> nil

def self.load_plugins: () -> (nil | untyped)

def self.init_plugins: (untyped options) -> untyped

def self.process_args: (?untyped args) -> untyped

# <!--
# rdoc-file=lib/minitest.rb
# - run(args = [])
# -->
# This is the top-level run method. Everything starts from here. It tells each
# Runnable sub-class to run, and each of those are responsible for doing
# whatever they do.
#
# The overall structure of a run looks like this:
#
# Minitest.autorun
# Minitest.run(args)
# Minitest.load_plugins
# Minitest.process_args
# Minitest.init_plugins
# Minitest.__run(reporter, options)
# Runnable.runnables.each
# runnable_klass.run(reporter, options)
# self.runnable_methods.each
# self.run_one_method(self, runnable_method, reporter)
# Minitest.run_one_method(klass, runnable_method)
# klass.new(runnable_method).run
#
def self.run: (?untyped args) -> untyped

def self.empty_run!: (untyped options) -> untyped

# <!--
# rdoc-file=lib/minitest.rb
# - __run(reporter, options)
# -->
# Internal run method. Responsible for telling all Runnable sub-classes to run.
#
def self.__run: (untyped reporter, untyped options) -> untyped

def self.filter_backtrace: (untyped bt) -> untyped

def self.run_one_method: (untyped klass, untyped method_name) -> untyped

def self.clock_time: () -> untyped

# <!--
# rdoc-file=lib/minitest/manual_plugins.rb
# - load(*names)
# -->
# Manually load plugins by name.
#
def self.load: (*untyped names) -> untyped

def self.plugin_pride_options: (untyped opts, untyped _options) -> untyped

def self.plugin_pride_init: (untyped options) -> (nil | untyped)

attr_accessor self.seed: untyped

attr_accessor self.parallel_executor: untyped

attr_accessor self.backtrace_filter: untyped

attr_accessor self.reporter: untyped

attr_accessor self.extensions: untyped

attr_accessor self.info_signal: untyped

attr_accessor self.allow_fork: untyped

VERSION: String
end
52 changes: 52 additions & 0 deletions gems/minitest/5.25/minitest/abstract_reporter.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# <!-- rdoc-file=lib/minitest.rb -->
# Defines the API for Reporters. Subclass this and override whatever you want.
# Go nuts.
#
class Minitest::AbstractReporter
@mutex: untyped
def initialize: () -> void

# <!--
# rdoc-file=lib/minitest.rb
# - start()
# -->
# Starts reporting on the run.
#
def start: () -> nil

# <!--
# rdoc-file=lib/minitest.rb
# - prerecord(klass, name)
# -->
# About to start running a test. This allows a reporter to show that it is
# starting or that we are in the middle of a test run.
#
def prerecord: (untyped klass, untyped name) -> nil

# <!--
# rdoc-file=lib/minitest.rb
# - record(result)
# -->
# Output and record the result of the test. Call
# [result#result_code](rdoc-ref:Runnable#result_code) to get the result
# character string. Stores the result of the run if the run did not pass.
#
def record: (untyped result) -> nil

# <!--
# rdoc-file=lib/minitest.rb
# - report()
# -->
# Outputs the summary of the run.
#
def report: () -> nil

# <!--
# rdoc-file=lib/minitest.rb
# - passed?()
# -->
# Did this run pass?
#
def passed?: () -> true
def synchronize: () { (?) -> untyped } -> untyped
end
17 changes: 17 additions & 0 deletions gems/minitest/5.25/minitest/assertion.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# <!-- rdoc-file=lib/minitest.rb -->
# Represents run failures.
#
class Minitest::Assertion < ::Exception
def error: () -> self

# <!--
# rdoc-file=lib/minitest.rb
# - location()
# -->
# Where was this run before an assertion was raised?
#
def location: () -> untyped
def result_code: () -> untyped
def result_label: () -> "Failure"
RE: Regexp
end
Loading

0 comments on commit ce6971e

Please sign in to comment.