orthoses-rails 0.4.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -39
  3. data/examples/rails/Gemfile +16 -0
  4. data/examples/rails/Gemfile.lock +178 -0
  5. data/examples/rails/Rakefile +149 -193
  6. data/examples/rails/config/database.yml +8 -0
  7. data/examples/rails/config/storage.yml +3 -0
  8. data/examples/rails/known_sig/actionpack/7.0/action_controller/metal.rbs +4 -0
  9. data/{lib/orthoses/active_model/known_sig/7.0 → examples/rails/known_sig/activemodel/7.0/active_model}/serialization.rbs +0 -0
  10. data/{lib/orthoses/active_model/known_sig/7.0 → examples/rails/known_sig/activemodel/7.0/active_model}/validations.rbs +0 -0
  11. data/examples/rails/known_sig/activerecord/6.0/_active_record_relation.rbs +49 -0
  12. data/examples/rails/known_sig/activerecord/6.0/_active_record_relation_class_methods.rbs +45 -0
  13. data/{lib/orthoses/active_record/known_sig/6.0 → examples/rails/known_sig/activerecord/6.0/active_record}/result.rbs +0 -0
  14. data/examples/rails/known_sig/activerecord/6.1/_active_record_relation.rbs +49 -0
  15. data/examples/rails/known_sig/activerecord/6.1/_active_record_relation_class_methods.rbs +45 -0
  16. data/{lib/orthoses/active_record/known_sig/6.1 → examples/rails/known_sig/activerecord/6.1/active_record}/result.rbs +0 -0
  17. data/examples/rails/known_sig/activerecord/7.0/_active_record_relation.rbs +49 -0
  18. data/examples/rails/known_sig/activerecord/7.0/_active_record_relation_class_methods.rbs +45 -0
  19. data/{lib/orthoses/active_record/known_sig/7.0 → examples/rails/known_sig/activerecord/7.0/active_record}/encryption/context.rbs +0 -0
  20. data/{lib/orthoses/active_record/known_sig/7.0 → examples/rails/known_sig/activerecord/7.0/active_record}/result.rbs +0 -0
  21. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/active_support/callbacks/callback_chain.rbs +0 -0
  22. data/examples/rails/known_sig/activesupport/7.0/active_support/duration.rbs +4 -0
  23. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/active_support/hash_with_indifferent_access.rbs +0 -0
  24. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/active_support/multibyte/chars.rbs +0 -0
  25. data/examples/rails/known_sig/activesupport/7.0/active_support/time_with_zone.rbs +5 -0
  26. data/examples/rails/known_sig/activesupport/7.0/active_support/time_zone.rbs +3 -0
  27. data/examples/rails/known_sig/activesupport/7.0/date.rbs +6 -0
  28. data/examples/rails/known_sig/activesupport/7.0/date_and_time/zones.rbs +4 -0
  29. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/hash_with_indifferent_access.rbs +0 -0
  30. data/examples/rails/known_sig/activesupport/7.0/integer.rbs +9 -0
  31. data/examples/rails/known_sig/activesupport/7.0/numeric.rbs +15 -0
  32. data/examples/rails/known_sig/activesupport/7.0/string.rbs +4 -0
  33. data/{lib/orthoses/active_support/known_sig → examples/rails/known_sig/activesupport}/7.0/time.rbs +8 -0
  34. data/examples/rails/tasks/action_pack.rake +141 -0
  35. data/examples/rails/tasks/action_view.rake +77 -0
  36. data/examples/rails/tasks/active_job.rake +99 -0
  37. data/examples/rails/tasks/active_model.rake +46 -0
  38. data/examples/rails/tasks/active_record.rake +88 -0
  39. data/examples/rails/tasks/active_storage.rake +94 -0
  40. data/examples/rails/tasks/active_support.rake +99 -0
  41. data/examples/rails/tasks/railties.rake +37 -0
  42. data/lib/orthoses/active_model/has_secure_password.rb +2 -10
  43. data/lib/orthoses/active_model.rb +0 -1
  44. data/lib/orthoses/active_record/delegated_type.rb +44 -0
  45. data/lib/orthoses/active_record/enum.rb +77 -0
  46. data/lib/orthoses/active_record/generated_attribute_methods.rb +1 -0
  47. data/lib/orthoses/active_record/scope.rb +63 -0
  48. data/lib/orthoses/active_record.rb +3 -1
  49. data/lib/orthoses/active_support/class_attribute.rb +3 -10
  50. data/lib/orthoses/active_support/configurable.rb +3 -2
  51. data/lib/orthoses/active_support/delegation.rb +11 -19
  52. data/lib/orthoses/active_support/mattr_accessor.rb +4 -12
  53. data/lib/orthoses/active_support/time_with_zone.rb +21 -3
  54. data/lib/orthoses/active_support.rb +0 -17
  55. data/lib/orthoses/rails/version.rb +1 -1
  56. data/lib/orthoses/rails.rb +1 -1
  57. data/lib/orthoses/railties/mixin.rb +107 -0
  58. data/lib/orthoses/railties.rb +3 -0
  59. data/orthoses-rails.gemspec +1 -1
  60. metadata +48 -89
  61. data/examples/rails/known_sig/action_cable/connection/test_cookie_jar.rbs +0 -2
  62. data/examples/rails/known_sig/action_controller/metal.rbs +0 -4
  63. data/examples/rails/known_sig/action_dispatch/cookies/cookie_jar.rbs +0 -3
  64. data/examples/rails/known_sig/action_dispatch/response.rbs +0 -4
  65. data/examples/rails/patch/drb/drb_undumped.rbs +0 -2
  66. data/examples/rails/patch/drb.rbs +0 -2
  67. data/examples/rails/patch/erubi/engine.rbs +0 -4
  68. data/examples/rails/patch/erubi.rbs +0 -2
  69. data/examples/rails/patch/minitest/kernel.rbs +0 -44
  70. data/examples/rails/patch/minitest/minitest/abstract_reporter.rbs +0 -49
  71. data/examples/rails/patch/minitest/minitest/assertion.rbs +0 -16
  72. data/examples/rails/patch/minitest/minitest/assertions.rbs +0 -545
  73. data/examples/rails/patch/minitest/minitest/backtrace_filter.rbs +0 -16
  74. data/examples/rails/patch/minitest/minitest/bench_spec.rbs +0 -101
  75. data/examples/rails/patch/minitest/minitest/benchmark.rbs +0 -258
  76. data/examples/rails/patch/minitest/minitest/composite_reporter.rbs +0 -25
  77. data/examples/rails/patch/minitest/minitest/expectations.rbs +0 -21
  78. data/examples/rails/patch/minitest/minitest/guard.rbs +0 -64
  79. data/examples/rails/patch/minitest/minitest/mock.rbs +0 -60
  80. data/examples/rails/patch/minitest/minitest/parallel/executor.rbs +0 -42
  81. data/examples/rails/patch/minitest/minitest/parallel/test/class_methods.rbs +0 -6
  82. data/examples/rails/patch/minitest/minitest/parallel/test.rbs +0 -3
  83. data/examples/rails/patch/minitest/minitest/parallel.rbs +0 -2
  84. data/examples/rails/patch/minitest/minitest/pride_io.rbs +0 -54
  85. data/examples/rails/patch/minitest/minitest/pride_lol.rbs +0 -17
  86. data/examples/rails/patch/minitest/minitest/progress_reporter.rbs +0 -11
  87. data/examples/rails/patch/minitest/minitest/reportable.rbs +0 -51
  88. data/examples/rails/patch/minitest/minitest/reporter.rbs +0 -5
  89. data/examples/rails/patch/minitest/minitest/result.rbs +0 -28
  90. data/examples/rails/patch/minitest/minitest/runnable.rbs +0 -131
  91. data/examples/rails/patch/minitest/minitest/skip.rbs +0 -6
  92. data/examples/rails/patch/minitest/minitest/spec/dsl/instance_methods.rbs +0 -48
  93. data/examples/rails/patch/minitest/minitest/spec/dsl.rbs +0 -125
  94. data/examples/rails/patch/minitest/minitest/spec.rbs +0 -10
  95. data/examples/rails/patch/minitest/minitest/statistics_reporter.rbs +0 -76
  96. data/examples/rails/patch/minitest/minitest/summary_reporter.rbs +0 -26
  97. data/examples/rails/patch/minitest/minitest/test/lifecycle_hooks.rbs +0 -92
  98. data/examples/rails/patch/minitest/minitest/test.rbs +0 -76
  99. data/examples/rails/patch/minitest/minitest/unexpected_error.rbs +0 -10
  100. data/examples/rails/patch/minitest/minitest/unit/test_case.rbs +0 -3
  101. data/examples/rails/patch/minitest/minitest/unit.rbs +0 -5
  102. data/examples/rails/patch/minitest/minitest.rbs +0 -966
  103. data/examples/rails/patch/pg/simple_decoder.rbs +0 -4
  104. data/examples/rails/patch/pg.rbs +0 -2
  105. data/examples/rails/patch/qc/queue.rbs +0 -2
  106. data/examples/rails/patch/qc.rbs +0 -2
  107. data/examples/rails/patch/que/job.rbs +0 -2
  108. data/examples/rails/patch/que.rbs +0 -2
  109. data/examples/rails/patch/rack/cache/entity_store.rbs +0 -2
  110. data/examples/rails/patch/rack/cache/meta_store.rbs +0 -2
  111. data/examples/rails/patch/rack/cache.rbs +0 -2
  112. data/examples/rails/patch/rack/session/dalli.rbs +0 -2
  113. data/examples/rails/patch/rack/session.rbs +0 -2
  114. data/examples/rails/patch/rboc.rbs +0 -2
  115. data/examples/rails/patch/rdoc/generator/sdoc.rbs +0 -3
  116. data/examples/rails/patch/rdoc/generator.rbs +0 -2
  117. data/examples/rails/patch/rdoc/task.rbs +0 -2
  118. data/examples/rails/patch/ripper.rbs +0 -2
  119. data/examples/rails/patch/sidekiq/worker.rbs +0 -2
  120. data/examples/rails/patch/sidekiq.rbs +0 -2
  121. data/examples/rails/patch/sneakers/worker.rbs +0 -2
  122. data/examples/rails/patch/sneakers.rbs +0 -2
  123. data/examples/rails/patch/sucker_punch/job.rbs +0 -2
  124. data/examples/rails/patch/sucker_punch.rbs +0 -2
  125. data/examples/rails/patch/thor/actions/create_file.rbs +0 -2
  126. data/examples/rails/patch/thor/actions.rbs +0 -2
  127. data/examples/rails/patch/thor/error.rbs +0 -2
  128. data/examples/rails/patch/thor/group.rbs +0 -2
  129. data/examples/rails/patch/thor.rbs +0 -2
  130. data/lib/orthoses/active_model/known_sig.rb +0 -21
  131. data/lib/orthoses/active_record/known_sig.rb +0 -21
  132. data/lib/orthoses/active_support/known_sig.rb +0 -21
  133. data/lib/orthoses/rails/known_sig_helper.rb +0 -22
@@ -1,131 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest.rb -->
2
- # Represents anything "runnable", like Test, Spec, Benchmark, or whatever you
3
- # can dream up.
4
- #
5
- # Subclasses of this are automatically registered and available in
6
- # Runnable.runnables.
7
- #
8
- class Minitest::Runnable
9
- def time_it: () { () -> untyped } -> untyped
10
-
11
- # <!--
12
- # rdoc-file=lib/minitest.rb
13
- # - name()
14
- # -->
15
- # Name of the run.
16
- #
17
- def name: () -> untyped
18
-
19
- # <!--
20
- # rdoc-file=lib/minitest.rb
21
- # - name=(o)
22
- # -->
23
- # Set the name of the run.
24
- #
25
- def name=: (untyped o) -> untyped
26
-
27
- # <!--
28
- # rdoc-file=lib/minitest.rb
29
- # - methods_matching(re)
30
- # -->
31
- # Returns all instance methods matching the pattern `re`.
32
- #
33
- def self.methods_matching: (untyped re) -> untyped
34
- def self.reset: () -> untyped
35
-
36
- # <!--
37
- # rdoc-file=lib/minitest.rb
38
- # - run(reporter, options = {})
39
- # -->
40
- # Responsible for running all runnable methods in a given class, each in its own
41
- # instance. Each instance is passed to the reporter to record.
42
- #
43
- def self.run: (untyped reporter, ?::Hash[untyped, untyped] options) -> (nil | untyped)
44
-
45
- # <!--
46
- # rdoc-file=lib/minitest.rb
47
- # - run_one_method(klass, method_name, reporter)
48
- # -->
49
- # Runs a single method and has the reporter record the result. This was
50
- # considered internal API but is factored out of run so that subclasses can
51
- # specialize the running of an individual test. See
52
- # Minitest::ParallelTest::ClassMethods for an example.
53
- #
54
- def self.run_one_method: (untyped klass, untyped method_name, untyped reporter) -> untyped
55
- def self.with_info_handler: (untyped reporter) { () -> untyped } -> untyped
56
- def self.on_signal: (untyped name, untyped action) { () -> untyped } -> untyped
57
-
58
- # <!--
59
- # rdoc-file=lib/minitest.rb
60
- # - runnable_methods()
61
- # -->
62
- # Each subclass of Runnable is responsible for overriding this method to return
63
- # all runnable methods. See #methods_matching.
64
- #
65
- def self.runnable_methods: () -> untyped
66
-
67
- # <!--
68
- # rdoc-file=lib/minitest.rb
69
- # - runnables()
70
- # -->
71
- # Returns all subclasses of Runnable.
72
- #
73
- def self.runnables: () -> untyped
74
- def marshal_dump: () -> ::Array[untyped]
75
- def marshal_load: (untyped ary) -> untyped
76
- def failure: () -> untyped
77
- def initialize: (untyped name) -> void
78
-
79
- # <!--
80
- # rdoc-file=lib/minitest.rb
81
- # - run()
82
- # -->
83
- # Runs a single method. Needs to return self.
84
- #
85
- def run: () -> untyped
86
-
87
- # <!--
88
- # rdoc-file=lib/minitest.rb
89
- # - passed?()
90
- # -->
91
- # Did this run pass?
92
- #
93
- # Note: skipped runs are not considered passing, but they don't cause the
94
- # process to exit non-zero.
95
- #
96
- def passed?: () -> untyped
97
-
98
- # <!--
99
- # rdoc-file=lib/minitest.rb
100
- # - result_code()
101
- # -->
102
- # Returns a single character string to print based on the result of the run. One
103
- # of `"."`, `"F"`, `"E"` or `"S"`.
104
- #
105
- def result_code: () -> untyped
106
-
107
- # <!--
108
- # rdoc-file=lib/minitest.rb
109
- # - skipped?()
110
- # -->
111
- # Was this run skipped? See #passed? for more information.
112
- #
113
- def skipped?: () -> untyped
114
- def self.inherited: (untyped klass) -> untyped
115
-
116
- # <!-- rdoc-file=lib/minitest.rb -->
117
- # Number of assertions executed in this run.
118
- #
119
- attr_accessor assertions: untyped
120
-
121
- # <!-- rdoc-file=lib/minitest.rb -->
122
- # An assertion raised during the run, if any.
123
- #
124
- attr_accessor failures: untyped
125
-
126
- # <!-- rdoc-file=lib/minitest.rb -->
127
- # The time it took to run.
128
- #
129
- attr_accessor time: untyped
130
- SIGNALS: Hash[String, Integer]
131
- end
@@ -1,6 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest.rb -->
2
- # Assertion raised when skipping a run.
3
- #
4
- class Minitest::Skip < ::Minitest::Assertion
5
- def result_label: () -> "Skipped"
6
- end
@@ -1,48 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest/spec.rb -->
2
- # Rdoc... why are you so dumb?
3
- #
4
- module Minitest::Spec::DSL::InstanceMethods
5
- # <!--
6
- # rdoc-file=lib/minitest/spec.rb
7
- # - _(value = nil, &block)
8
- # -->
9
- # Takes a value or a block and returns a value monad that has all of
10
- # Expectations methods available to it.
11
- #
12
- # _(1 + 1).must_equal 2
13
- #
14
- # And for blocks:
15
- #
16
- # _ { 1 + "1" }.must_raise TypeError
17
- #
18
- # This method of expectation-based testing is preferable to straight-expectation
19
- # methods (on Object) because it stores its test context, bypassing our hacky
20
- # use of thread-local variables.
21
- #
22
- # NOTE: At some point, the methods on Object will be deprecated and then
23
- # removed.
24
- #
25
- # It is also aliased to #value and #expect for your aesthetic pleasure:
26
- #
27
- # _(1 + 1).must_equal 2
28
- # value(1 + 1).must_equal 2
29
- # expect(1 + 1).must_equal 2
30
- #
31
- def _: (?untyped? value) { () -> untyped } -> untyped
32
-
33
- # <!--
34
- # rdoc-file=lib/minitest/spec.rb
35
- # - value(value = nil, &block)
36
- # -->
37
- #
38
- alias value _
39
-
40
- # <!--
41
- # rdoc-file=lib/minitest/spec.rb
42
- # - expect(value = nil, &block)
43
- # -->
44
- #
45
- alias expect _
46
-
47
- def before_setup: () -> untyped
48
- end
@@ -1,125 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest/spec.rb -->
2
- # Oh look! A Minitest::Spec::DSL module! Eat your heart out DHH.
3
- #
4
- module Minitest::Spec::DSL
5
- # <!--
6
- # rdoc-file=lib/minitest/spec.rb
7
- # - register_spec_type(*args, &block)
8
- # -->
9
- # Register a new type of spec that matches the spec's description. This method
10
- # can take either a Regexp and a spec class or a spec class and a block that
11
- # takes the description and returns true if it matches.
12
- #
13
- # Eg:
14
- #
15
- # register_spec_type(/Controller$/, Minitest::Spec::Rails)
16
- #
17
- # or:
18
- #
19
- # register_spec_type(Minitest::Spec::RailsModel) do |desc|
20
- # desc.superclass == ActiveRecord::Base
21
- # end
22
- #
23
- def register_spec_type: (*untyped args) { () -> untyped } -> untyped
24
-
25
- # <!--
26
- # rdoc-file=lib/minitest/spec.rb
27
- # - spec_type(desc, *additional)
28
- # -->
29
- # Figure out the spec class to use based on a spec's description. Eg:
30
- #
31
- # spec_type("BlahController") # => Minitest::Spec::Rails
32
- #
33
- def spec_type: (untyped desc, *untyped additional) -> untyped
34
-
35
- def describe_stack: () -> untyped
36
-
37
- def children: () -> untyped
38
-
39
- def nuke_test_methods!: () -> untyped
40
-
41
- # <!--
42
- # rdoc-file=lib/minitest/spec.rb
43
- # - before(_type = nil, &block)
44
- # -->
45
- # Define a 'before' action. Inherits the way normal methods should.
46
- #
47
- # NOTE: `type` is ignored and is only there to make porting easier.
48
- #
49
- # Equivalent to Minitest::Test#setup.
50
- #
51
- def before: (?untyped? _type) { () -> untyped } -> untyped
52
-
53
- # <!--
54
- # rdoc-file=lib/minitest/spec.rb
55
- # - after(_type = nil, &block)
56
- # -->
57
- # Define an 'after' action. Inherits the way normal methods should.
58
- #
59
- # NOTE: `type` is ignored and is only there to make porting easier.
60
- #
61
- # Equivalent to Minitest::Test#teardown.
62
- #
63
- def after: (?untyped? _type) { () -> untyped } -> untyped
64
-
65
- # <!--
66
- # rdoc-file=lib/minitest/spec.rb
67
- # - it(desc = "anonymous", &block)
68
- # -->
69
- # Define an expectation with name `desc`. Name gets morphed to a proper test
70
- # method name. For some freakish reason, people who write specs don't like class
71
- # inheritance, so this goes way out of its way to make sure that expectations
72
- # aren't inherited.
73
- #
74
- # This is also aliased to #specify and doesn't require a `desc` arg.
75
- #
76
- # Hint: If you *do* want inheritance, use minitest/test. You can mix and match
77
- # between assertions and expectations as much as you want.
78
- #
79
- def it: (?::String desc) { () -> untyped } -> untyped
80
-
81
- # <!--
82
- # rdoc-file=lib/minitest/spec.rb
83
- # - let(name, &block)
84
- # -->
85
- # Essentially, define an accessor for `name` with `block`.
86
- #
87
- # Why use let instead of def? I honestly don't know.
88
- #
89
- def let: (untyped name) { () -> untyped } -> untyped
90
-
91
- # <!--
92
- # rdoc-file=lib/minitest/spec.rb
93
- # - subject(&block)
94
- # -->
95
- # Another lazy man's accessor generator. Made even more lazy by setting the name
96
- # for you to `subject`.
97
- #
98
- def subject: () { () -> untyped } -> untyped
99
-
100
- def create: (untyped name, untyped desc) -> untyped
101
-
102
- def name: () -> untyped
103
-
104
- def to_s: () -> untyped
105
-
106
- # <!--
107
- # rdoc-file=lib/minitest/spec.rb
108
- # - specify(desc = "anonymous", &block)
109
- # -->
110
- #
111
- alias specify it
112
-
113
- def self.extended: (untyped obj) -> untyped
114
-
115
- attr_reader desc: untyped
116
-
117
- # <!-- rdoc-file=lib/minitest/spec.rb -->
118
- # Contains pairs of matchers and Spec classes to be used to calculate the
119
- # superclass of a top-level describe. This allows for automatically customizable
120
- # spec types.
121
- #
122
- # See: register_spec_type and spec_type
123
- #
124
- TYPES: Array[Array[Regexp | singleton(Minitest::BenchSpec)] | Array[Regexp | singleton(Minitest::Spec)]]
125
- end
@@ -1,10 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest/spec.rb -->
2
- # Minitest::Spec -- The faster, better, less-magical spec framework!
3
- #
4
- # For a list of expectations, see Minitest::Expectations.
5
- #
6
- class Minitest::Spec < ::Minitest::Test
7
- def self.current: () -> untyped
8
- def initialize: (untyped name) -> void
9
- include Minitest::Spec::DSL::InstanceMethods
10
- end
@@ -1,76 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest.rb -->
2
- # A reporter that gathers statistics about a test run. Does not do any IO
3
- # because meant to be used as a parent class for a reporter that does.
4
- #
5
- # If you want to create an entirely different type of output (eg, CI, HTML,
6
- # etc), this is the place to start.
7
- #
8
- # Example:
9
- #
10
- # class JenkinsCIReporter < StatisticsReporter
11
- # def report
12
- # super # Needed to calculate some statistics
13
- #
14
- # print "<testsuite "
15
- # print "tests='#{count}' "
16
- # print "failures='#{failures}' "
17
- # # Remaining XML...
18
- # end
19
- # end
20
- #
21
- class Minitest::StatisticsReporter < ::Minitest::Reporter
22
- def initialize: (?untyped io, ?::Hash[untyped, untyped] options) -> void
23
- def passed?: () -> untyped
24
- def start: () -> untyped
25
- def record: (untyped result) -> untyped
26
-
27
- # <!--
28
- # rdoc-file=lib/minitest.rb
29
- # - report()
30
- # -->
31
- # Report on the tracked statistics.
32
- #
33
- def report: () -> untyped
34
-
35
- # <!-- rdoc-file=lib/minitest.rb -->
36
- # Total number of assertions.
37
- #
38
- attr_accessor assertions: untyped
39
-
40
- # <!-- rdoc-file=lib/minitest.rb -->
41
- # Total number of test cases.
42
- #
43
- attr_accessor count: untyped
44
-
45
- # <!-- rdoc-file=lib/minitest.rb -->
46
- # An `Array` of test cases that failed or were skipped.
47
- #
48
- attr_accessor results: untyped
49
-
50
- # <!-- rdoc-file=lib/minitest.rb -->
51
- # Time the test run started. If available, the monotonic clock is used and this
52
- # is a `Float`, otherwise it's an instance of `Time`.
53
- #
54
- attr_accessor start_time: untyped
55
-
56
- # <!-- rdoc-file=lib/minitest.rb -->
57
- # Test run time. If available, the monotonic clock is used and this is a
58
- # `Float`, otherwise it's an instance of `Time`.
59
- #
60
- attr_accessor total_time: untyped
61
-
62
- # <!-- rdoc-file=lib/minitest.rb -->
63
- # Total number of tests that failed.
64
- #
65
- attr_accessor failures: untyped
66
-
67
- # <!-- rdoc-file=lib/minitest.rb -->
68
- # Total number of tests that erred.
69
- #
70
- attr_accessor errors: untyped
71
-
72
- # <!-- rdoc-file=lib/minitest.rb -->
73
- # Total number of tests that where skipped.
74
- #
75
- attr_accessor skips: untyped
76
- end
@@ -1,26 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest.rb -->
2
- # A reporter that prints the header, summary, and failure details at the end of
3
- # the run.
4
- #
5
- # This is added to the top-level CompositeReporter at the start of the run. If
6
- # you want to change the output of minitest via a plugin, pull this out of the
7
- # composite and replace it with your own.
8
- #
9
- class Minitest::SummaryReporter < ::Minitest::StatisticsReporter
10
- def start: () -> untyped
11
- def report: () -> untyped
12
- def statistics: () -> untyped
13
- def aggregated_results: (untyped io) -> untyped
14
- def to_s: () -> untyped
15
- def summary: () -> untyped
16
- private
17
-
18
- # <!--
19
- # rdoc-file=lib/minitest.rb
20
- # - binary_string()
21
- # -->
22
- #
23
- def binary_string: () -> untyped
24
- attr_accessor sync: untyped
25
- attr_accessor old_sync: untyped
26
- end
@@ -1,92 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest/test.rb -->
2
- # Provides before/after hooks for setup and teardown. These are meant for
3
- # library writers, NOT for regular test authors. See #before_setup for an
4
- # example.
5
- #
6
- module Minitest::Test::LifecycleHooks
7
- # <!--
8
- # rdoc-file=lib/minitest/test.rb
9
- # - before_setup()
10
- # -->
11
- # Runs before every test, before setup. This hook is meant for libraries to
12
- # extend minitest. It is not meant to be used by test developers.
13
- #
14
- # As a simplistic example:
15
- #
16
- # module MyMinitestPlugin
17
- # def before_setup
18
- # super
19
- # # ... stuff to do before setup is run
20
- # end
21
- #
22
- # def after_setup
23
- # # ... stuff to do after setup is run
24
- # super
25
- # end
26
- #
27
- # def before_teardown
28
- # super
29
- # # ... stuff to do before teardown is run
30
- # end
31
- #
32
- # def after_teardown
33
- # # ... stuff to do after teardown is run
34
- # super
35
- # end
36
- # end
37
- #
38
- # class MiniTest::Test
39
- # include MyMinitestPlugin
40
- # end
41
- #
42
- def before_setup: () -> nil
43
-
44
- # <!--
45
- # rdoc-file=lib/minitest/test.rb
46
- # - setup()
47
- # -->
48
- # Runs before every test. Use this to set up before each test run.
49
- #
50
- def setup: () -> nil
51
-
52
- # <!--
53
- # rdoc-file=lib/minitest/test.rb
54
- # - after_setup()
55
- # -->
56
- # Runs before every test, after setup. This hook is meant for libraries to
57
- # extend minitest. It is not meant to be used by test developers.
58
- #
59
- # See #before_setup for an example.
60
- #
61
- def after_setup: () -> nil
62
-
63
- # <!--
64
- # rdoc-file=lib/minitest/test.rb
65
- # - before_teardown()
66
- # -->
67
- # Runs after every test, before teardown. This hook is meant for libraries to
68
- # extend minitest. It is not meant to be used by test developers.
69
- #
70
- # See #before_setup for an example.
71
- #
72
- def before_teardown: () -> nil
73
-
74
- # <!--
75
- # rdoc-file=lib/minitest/test.rb
76
- # - teardown()
77
- # -->
78
- # Runs after every test. Use this to clean up after each test run.
79
- #
80
- def teardown: () -> nil
81
-
82
- # <!--
83
- # rdoc-file=lib/minitest/test.rb
84
- # - after_teardown()
85
- # -->
86
- # Runs after every test, after teardown. This hook is meant for libraries to
87
- # extend minitest. It is not meant to be used by test developers.
88
- #
89
- # See #before_setup for an example.
90
- #
91
- def after_teardown: () -> nil
92
- end
@@ -1,76 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest/test.rb -->
2
- # Subclass Test to create your own tests. Typically you'll want a Test subclass
3
- # per implementation class.
4
- #
5
- # See Minitest::Assertions
6
- #
7
- class Minitest::Test < ::Minitest::Runnable
8
- def class_name: () -> untyped
9
-
10
- # <!--
11
- # rdoc-file=lib/minitest/test.rb
12
- # - i_suck_and_my_tests_are_order_dependent!()
13
- # -->
14
- # Call this at the top of your tests when you absolutely positively need to have
15
- # ordered tests. In doing so, you're admitting that you suck and your tests are
16
- # weak.
17
- #
18
- def self.i_suck_and_my_tests_are_order_dependent!: () -> untyped
19
-
20
- # <!--
21
- # rdoc-file=lib/minitest/test.rb
22
- # - make_my_diffs_pretty!()
23
- # -->
24
- # Make diffs for this Test use #pretty_inspect so that diff in assert_equal can
25
- # have more details. NOTE: this is much slower than the regular inspect but much
26
- # more usable for complex objects.
27
- #
28
- def self.make_my_diffs_pretty!: () -> untyped
29
-
30
- # <!--
31
- # rdoc-file=lib/minitest/test.rb
32
- # - parallelize_me!()
33
- # -->
34
- # Call this at the top of your tests when you want to run your tests in
35
- # parallel. In doing so, you're admitting that you rule and your tests are
36
- # awesome.
37
- #
38
- def self.parallelize_me!: () -> untyped
39
-
40
- # <!--
41
- # rdoc-file=lib/minitest/test.rb
42
- # - runnable_methods()
43
- # -->
44
- # Returns all instance methods starting with "test_". Based on #test_order, the
45
- # methods are either sorted, randomized (default), or run in parallel.
46
- #
47
- def self.runnable_methods: () -> untyped
48
-
49
- # <!--
50
- # rdoc-file=lib/minitest/test.rb
51
- # - test_order()
52
- # -->
53
- # Defines the order to run tests (:random by default). Override this or use a
54
- # convenience method to change it for your tests.
55
- #
56
- def self.test_order: () -> :random
57
-
58
- # <!--
59
- # rdoc-file=lib/minitest/test.rb
60
- # - run()
61
- # -->
62
- # Runs a single test with setup/teardown hooks.
63
- #
64
- def run: () -> untyped
65
- def capture_exceptions: () { () -> untyped } -> untyped
66
- def sanitize_exception: (untyped e) -> untyped
67
- def with_info_handler: () { () -> untyped } -> untyped
68
- attr_accessor self.io_lock: untyped
69
- include Minitest::Assertions
70
- include Minitest::Reportable
71
- include Minitest::Test::LifecycleHooks
72
- include Minitest::Guard
73
- extend Minitest::Guard
74
- TEARDOWN_METHODS: Array[String]
75
- PASSTHROUGH_EXCEPTIONS: Array[singleton(NoMemoryError) | singleton(SignalException) | singleton(SystemExit)]
76
- end
@@ -1,10 +0,0 @@
1
- # <!-- rdoc-file=lib/minitest.rb -->
2
- # Assertion wrapping an unexpected error that was raised during a run.
3
- #
4
- class Minitest::UnexpectedError < ::Minitest::Assertion
5
- def initialize: (untyped error) -> void
6
- def backtrace: () -> untyped
7
- def message: () -> ::String
8
- def result_label: () -> "Error"
9
- attr_accessor error: untyped
10
- end
@@ -1,3 +0,0 @@
1
- class Minitest::Unit::TestCase < ::Minitest::Test
2
- def self.inherited: (untyped klass) -> untyped
3
- end
@@ -1,5 +0,0 @@
1
- class Minitest::Unit
2
- def self.autorun: () -> untyped
3
- def self.after_tests: () { () -> untyped } -> untyped
4
- VERSION: String
5
- end