forked from ruby/gem_rbs_collection
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See also: - ruby/rbs#2258 - ruby/rbs#1009 - ruby/rbs#1694 - ruby/rbs#2093 Thank you: - @ksss - @stevegeek
- Loading branch information
Showing
40 changed files
with
2,258 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.