mocktail 1.2.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +6 -5
  3. data/.gitignore +3 -0
  4. data/.standard.yml +8 -0
  5. data/CHANGELOG.md +14 -0
  6. data/Gemfile +6 -1
  7. data/Gemfile.lock +98 -25
  8. data/README.md +18 -922
  9. data/Rakefile +0 -1
  10. data/bin/console +1 -2
  11. data/bin/tapioca +29 -0
  12. data/lib/mocktail/collects_calls.rb +2 -0
  13. data/lib/mocktail/debug.rb +13 -10
  14. data/lib/mocktail/dsl.rb +2 -0
  15. data/lib/mocktail/errors.rb +2 -0
  16. data/lib/mocktail/explains_nils.rb +2 -0
  17. data/lib/mocktail/explains_thing.rb +7 -4
  18. data/lib/mocktail/grabs_original_method_parameters.rb +30 -0
  19. data/lib/mocktail/handles_dry_call/fulfills_stubbing/describes_unsatisfied_stubbing.rb +3 -1
  20. data/lib/mocktail/handles_dry_call/fulfills_stubbing/finds_satisfaction.rb +5 -1
  21. data/lib/mocktail/handles_dry_call/fulfills_stubbing.rb +2 -0
  22. data/lib/mocktail/handles_dry_call/logs_call.rb +2 -0
  23. data/lib/mocktail/handles_dry_call/validates_arguments.rb +6 -4
  24. data/lib/mocktail/handles_dry_call.rb +2 -0
  25. data/lib/mocktail/handles_dry_new_call.rb +2 -0
  26. data/lib/mocktail/imitates_type/ensures_imitation_support.rb +2 -0
  27. data/lib/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb +4 -1
  28. data/lib/mocktail/imitates_type/makes_double/declares_dry_class.rb +32 -20
  29. data/lib/mocktail/imitates_type/makes_double/gathers_fakeable_instance_methods.rb +2 -0
  30. data/lib/mocktail/imitates_type/makes_double.rb +3 -0
  31. data/lib/mocktail/imitates_type.rb +3 -1
  32. data/lib/mocktail/initialize_based_on_type_system_mode_switching.rb +9 -0
  33. data/lib/mocktail/initializes_mocktail.rb +5 -0
  34. data/lib/mocktail/matcher_presentation.rb +4 -2
  35. data/lib/mocktail/matchers/any.rb +4 -3
  36. data/lib/mocktail/matchers/base.rb +10 -2
  37. data/lib/mocktail/matchers/captor.rb +9 -0
  38. data/lib/mocktail/matchers/includes.rb +2 -0
  39. data/lib/mocktail/matchers/includes_hash.rb +9 -0
  40. data/lib/mocktail/matchers/includes_key.rb +9 -0
  41. data/lib/mocktail/matchers/includes_string.rb +9 -0
  42. data/lib/mocktail/matchers/is_a.rb +2 -0
  43. data/lib/mocktail/matchers/matches.rb +2 -0
  44. data/lib/mocktail/matchers/not.rb +2 -0
  45. data/lib/mocktail/matchers/numeric.rb +5 -4
  46. data/lib/mocktail/matchers/that.rb +2 -0
  47. data/lib/mocktail/matchers.rb +3 -0
  48. data/lib/mocktail/raises_neato_no_method_error.rb +2 -0
  49. data/lib/mocktail/records_demonstration.rb +2 -0
  50. data/lib/mocktail/registers_matcher.rb +8 -3
  51. data/lib/mocktail/registers_stubbing.rb +2 -0
  52. data/lib/mocktail/replaces_next.rb +7 -1
  53. data/lib/mocktail/replaces_type/redefines_new.rb +3 -1
  54. data/lib/mocktail/replaces_type/redefines_singleton_methods.rb +14 -2
  55. data/lib/mocktail/replaces_type/runs_sorbet_sig_blocks_before_replacement.rb +37 -0
  56. data/lib/mocktail/replaces_type.rb +6 -0
  57. data/lib/mocktail/resets_state.rb +2 -0
  58. data/lib/mocktail/share/bind.rb +7 -5
  59. data/lib/mocktail/share/cleans_backtrace.rb +3 -5
  60. data/lib/mocktail/share/creates_identifier.rb +16 -9
  61. data/lib/mocktail/share/determines_matching_calls.rb +4 -2
  62. data/lib/mocktail/share/stringifies_call.rb +6 -2
  63. data/lib/mocktail/share/stringifies_method_name.rb +3 -1
  64. data/lib/mocktail/simulates_argument_error/reconciles_args_with_params.rb +2 -0
  65. data/lib/mocktail/simulates_argument_error/recreates_message.rb +2 -0
  66. data/lib/mocktail/simulates_argument_error/transforms_params.rb +15 -8
  67. data/lib/mocktail/simulates_argument_error.rb +2 -0
  68. data/lib/mocktail/sorbet/mocktail/collects_calls.rb +18 -0
  69. data/lib/mocktail/sorbet/mocktail/debug.rb +54 -0
  70. data/lib/mocktail/sorbet/mocktail/dsl.rb +46 -0
  71. data/lib/mocktail/sorbet/mocktail/errors.rb +19 -0
  72. data/lib/mocktail/sorbet/mocktail/explains_nils.rb +41 -0
  73. data/lib/mocktail/sorbet/mocktail/explains_thing.rb +137 -0
  74. data/lib/mocktail/sorbet/mocktail/grabs_original_method_parameters.rb +33 -0
  75. data/lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing/describes_unsatisfied_stubbing.rb +27 -0
  76. data/lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing/finds_satisfaction.rb +24 -0
  77. data/lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing.rb +45 -0
  78. data/lib/mocktail/sorbet/mocktail/handles_dry_call/logs_call.rb +12 -0
  79. data/lib/mocktail/sorbet/mocktail/handles_dry_call/validates_arguments.rb +45 -0
  80. data/lib/mocktail/sorbet/mocktail/handles_dry_call.rb +25 -0
  81. data/lib/mocktail/sorbet/mocktail/handles_dry_new_call.rb +42 -0
  82. data/lib/mocktail/sorbet/mocktail/imitates_type/ensures_imitation_support.rb +16 -0
  83. data/lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb +73 -0
  84. data/lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb +136 -0
  85. data/lib/mocktail/sorbet/mocktail/imitates_type/makes_double/gathers_fakeable_instance_methods.rb +28 -0
  86. data/lib/mocktail/sorbet/mocktail/imitates_type/makes_double.rb +29 -0
  87. data/lib/mocktail/sorbet/mocktail/imitates_type.rb +29 -0
  88. data/lib/mocktail/sorbet/mocktail/initialize_based_on_type_system_mode_switching.rb +11 -0
  89. data/lib/mocktail/sorbet/mocktail/initializes_mocktail.rb +25 -0
  90. data/lib/mocktail/sorbet/mocktail/matcher_presentation.rb +21 -0
  91. data/lib/mocktail/sorbet/mocktail/matchers/any.rb +27 -0
  92. data/lib/mocktail/sorbet/mocktail/matchers/base.rb +39 -0
  93. data/lib/mocktail/sorbet/mocktail/matchers/captor.rb +76 -0
  94. data/lib/mocktail/sorbet/mocktail/matchers/includes.rb +32 -0
  95. data/lib/mocktail/sorbet/mocktail/matchers/includes_hash.rb +12 -0
  96. data/lib/mocktail/sorbet/mocktail/matchers/includes_key.rb +12 -0
  97. data/lib/mocktail/sorbet/mocktail/matchers/includes_string.rb +12 -0
  98. data/lib/mocktail/sorbet/mocktail/matchers/is_a.rb +17 -0
  99. data/lib/mocktail/sorbet/mocktail/matchers/matches.rb +19 -0
  100. data/lib/mocktail/sorbet/mocktail/matchers/not.rb +17 -0
  101. data/lib/mocktail/sorbet/mocktail/matchers/numeric.rb +27 -0
  102. data/lib/mocktail/sorbet/mocktail/matchers/that.rb +32 -0
  103. data/lib/mocktail/sorbet/mocktail/matchers.rb +19 -0
  104. data/lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb +93 -0
  105. data/lib/mocktail/sorbet/mocktail/records_demonstration.rb +43 -0
  106. data/lib/mocktail/sorbet/mocktail/registers_matcher.rb +65 -0
  107. data/lib/mocktail/sorbet/mocktail/registers_stubbing.rb +31 -0
  108. data/lib/mocktail/sorbet/mocktail/replaces_next.rb +55 -0
  109. data/lib/mocktail/sorbet/mocktail/replaces_type/redefines_new.rb +32 -0
  110. data/lib/mocktail/sorbet/mocktail/replaces_type/redefines_singleton_methods.rb +80 -0
  111. data/lib/mocktail/sorbet/mocktail/replaces_type/runs_sorbet_sig_blocks_before_replacement.rb +39 -0
  112. data/lib/mocktail/sorbet/mocktail/replaces_type.rb +36 -0
  113. data/lib/mocktail/sorbet/mocktail/resets_state.rb +14 -0
  114. data/lib/mocktail/sorbet/mocktail/share/bind.rb +18 -0
  115. data/lib/mocktail/sorbet/mocktail/share/cleans_backtrace.rb +22 -0
  116. data/lib/mocktail/sorbet/mocktail/share/creates_identifier.rb +39 -0
  117. data/lib/mocktail/sorbet/mocktail/share/determines_matching_calls.rb +72 -0
  118. data/lib/mocktail/sorbet/mocktail/share/stringifies_call.rb +85 -0
  119. data/lib/mocktail/sorbet/mocktail/share/stringifies_method_name.rb +16 -0
  120. data/lib/mocktail/sorbet/mocktail/simulates_argument_error/reconciles_args_with_params.rb +27 -0
  121. data/lib/mocktail/sorbet/mocktail/simulates_argument_error/recreates_message.rb +34 -0
  122. data/lib/mocktail/sorbet/mocktail/simulates_argument_error/transforms_params.rb +58 -0
  123. data/lib/mocktail/sorbet/mocktail/simulates_argument_error.rb +36 -0
  124. data/lib/mocktail/sorbet/mocktail/sorbet.rb +3 -0
  125. data/lib/mocktail/sorbet/mocktail/stringifies_method_signature.rb +53 -0
  126. data/lib/mocktail/sorbet/mocktail/typed.rb +5 -0
  127. data/lib/mocktail/sorbet/mocktail/value/cabinet.rb +91 -0
  128. data/lib/mocktail/sorbet/mocktail/value/call.rb +51 -0
  129. data/lib/mocktail/sorbet/mocktail/value/demo_config.rb +10 -0
  130. data/lib/mocktail/sorbet/mocktail/value/double.rb +10 -0
  131. data/lib/mocktail/sorbet/mocktail/value/double_data.rb +15 -0
  132. data/lib/mocktail/sorbet/mocktail/value/explanation.rb +68 -0
  133. data/lib/mocktail/sorbet/mocktail/value/explanation_data.rb +19 -0
  134. data/lib/mocktail/sorbet/mocktail/value/fake_method_data.rb +11 -0
  135. data/lib/mocktail/sorbet/mocktail/value/matcher_registry.rb +27 -0
  136. data/lib/mocktail/sorbet/mocktail/value/no_explanation_data.rb +20 -0
  137. data/lib/mocktail/sorbet/mocktail/value/signature.rb +35 -0
  138. data/lib/mocktail/sorbet/mocktail/value/stubbing.rb +26 -0
  139. data/lib/mocktail/sorbet/mocktail/value/top_shelf.rb +79 -0
  140. data/lib/mocktail/sorbet/mocktail/value/type_replacement.rb +11 -0
  141. data/lib/mocktail/sorbet/mocktail/value/type_replacement_data.rb +19 -0
  142. data/lib/mocktail/sorbet/mocktail/value/unsatisfying_call.rb +9 -0
  143. data/lib/mocktail/sorbet/mocktail/value/unsatisfying_call_explanation.rb +24 -0
  144. data/lib/mocktail/sorbet/mocktail/value.rb +19 -0
  145. data/lib/mocktail/sorbet/mocktail/verifies_call/finds_verifiable_calls.rb +21 -0
  146. data/lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error/gathers_calls_of_method.rb +15 -0
  147. data/lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error.rb +74 -0
  148. data/lib/mocktail/sorbet/mocktail/verifies_call.rb +37 -0
  149. data/lib/mocktail/sorbet/mocktail/version.rb +12 -0
  150. data/lib/mocktail/sorbet/mocktail.rb +154 -0
  151. data/lib/mocktail/sorbet.rb +1 -0
  152. data/lib/mocktail/stringifies_method_signature.rb +2 -0
  153. data/lib/mocktail/typed.rb +3 -0
  154. data/lib/mocktail/value/cabinet.rb +8 -1
  155. data/lib/mocktail/value/call.rb +44 -12
  156. data/lib/mocktail/value/demo_config.rb +6 -7
  157. data/lib/mocktail/value/double.rb +6 -7
  158. data/lib/mocktail/value/double_data.rb +11 -7
  159. data/lib/mocktail/value/explanation.rb +28 -3
  160. data/lib/mocktail/value/explanation_data.rb +14 -0
  161. data/lib/mocktail/value/fake_method_data.rb +7 -6
  162. data/lib/mocktail/value/matcher_registry.rb +2 -0
  163. data/lib/mocktail/value/no_explanation_data.rb +16 -0
  164. data/lib/mocktail/value/signature.rb +19 -27
  165. data/lib/mocktail/value/stubbing.rb +11 -12
  166. data/lib/mocktail/value/top_shelf.rb +5 -0
  167. data/lib/mocktail/value/type_replacement.rb +7 -8
  168. data/lib/mocktail/value/type_replacement_data.rb +10 -7
  169. data/lib/mocktail/value/unsatisfying_call.rb +5 -6
  170. data/lib/mocktail/value/unsatisfying_call_explanation.rb +18 -0
  171. data/lib/mocktail/value.rb +5 -2
  172. data/lib/mocktail/verifies_call/finds_verifiable_calls.rb +2 -0
  173. data/lib/mocktail/verifies_call/raises_verification_error/gathers_calls_of_method.rb +2 -0
  174. data/lib/mocktail/verifies_call/raises_verification_error.rb +2 -0
  175. data/lib/mocktail/verifies_call.rb +3 -0
  176. data/lib/mocktail/version.rb +8 -1
  177. data/lib/mocktail.rb +46 -5
  178. data/mocktail.gemspec +8 -4
  179. data/rbi/mocktail-pregenerated.rbi +1865 -0
  180. data/rbi/mocktail.rbi +77 -0
  181. data/rbi/sorbet-runtime.rbi +29 -0
  182. data/spoom_report.html +1248 -0
  183. metadata +130 -3
@@ -0,0 +1,1865 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `mocktail` gem.
5
+ # Please instead update this file by running `bin/tapioca gem mocktail`.
6
+
7
+ # typed: true
8
+
9
+ # DO NOT EDIT MANUALLY
10
+ # This is an autogenerated file for types exported from the `mocktail` gem.
11
+ # Please instead update this file by running `bin/tapioca gem mocktail`.
12
+
13
+ # The Cabinet stores all thread-local state, so anything that goes here
14
+ # is guaranteed by Mocktail to be local to the currently-running thread
15
+ #
16
+ # source://mocktail//lib/mocktail/sorbet/mocktail/typed.rb#3
17
+ # The Cabinet stores all thread-local state, so anything that goes here
18
+ module Mocktail
19
+ extend ::Mocktail::DSL
20
+
21
+ class << self
22
+ # Stores most transactional state about calls & stubbing configurations
23
+ # Anything returned by this is undocumented and could change at any time, so
24
+ # don't commit code that relies on it!
25
+ #
26
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#149
27
+ sig { returns(::Mocktail::Cabinet) }
28
+ def cabinet; end
29
+
30
+ # An alias for Mocktail.explain(double).reference.calls
31
+ # Takes an optional second parameter of the method name to filter only
32
+ # calls to that method
33
+ #
34
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#141
35
+ sig do
36
+ params(
37
+ double: ::Object,
38
+ method_name: T.nilable(T.any(::String, ::Symbol))
39
+ ).returns(T::Array[::Mocktail::Call])
40
+ end
41
+ def calls(double, method_name = T.unsafe(nil)); end
42
+
43
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#99
44
+ sig { returns(::Mocktail::Matchers::Captor) }
45
+ def captor; end
46
+
47
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#125
48
+ sig { params(thing: ::Object).returns(::Mocktail::Explanation) }
49
+ def explain(thing); end
50
+
51
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#130
52
+ sig { returns(T::Array[::Mocktail::UnsatisfyingCallExplanation]) }
53
+ def explain_nils; end
54
+
55
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#94
56
+ sig { returns(::Mocktail::MatcherPresentation) }
57
+ def matchers; end
58
+
59
+ # Returns an instance of `type` whose implementation is mocked out
60
+ #
61
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#52
62
+ sig do
63
+ type_parameters(:T)
64
+ .params(
65
+ type: T::Class[T.all(::Object, T.type_parameter(:T))]
66
+ ).returns(T.all(::Object, T.type_parameter(:T)))
67
+ end
68
+ def of(type); end
69
+
70
+ # Returns an instance of `klass` whose implementation is mocked out AND
71
+ # stubs its constructor to return that fake the next time klass.new is called
72
+ #
73
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#63
74
+ sig do
75
+ type_parameters(:T)
76
+ .params(
77
+ type: T::Class[T.all(::Object, T.type_parameter(:T))],
78
+ count: T.nilable(::Integer)
79
+ ).returns(T.type_parameter(:T))
80
+ end
81
+ def of_next(type, count: T.unsafe(nil)); end
82
+
83
+ # An alias of of_next that always returns an array of fakes
84
+ #
85
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#89
86
+ sig do
87
+ type_parameters(:T)
88
+ .params(
89
+ type: T::Class[T.all(::Object, T.type_parameter(:T))],
90
+ count: ::Integer
91
+ ).returns(T::Array[T.type_parameter(:T)])
92
+ end
93
+ def of_next_with_count(type, count); end
94
+
95
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#104
96
+ sig { params(matcher: T.class_of(Mocktail::Matchers::Base)).void }
97
+ def register_matcher(matcher); end
98
+
99
+ # Replaces every singleton method on `type` with a fake, and when instantiated
100
+ # or included will also fake instance methods
101
+ #
102
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#111
103
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
104
+ def replace(type); end
105
+
106
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#117
107
+ sig { void }
108
+ def reset; end
109
+ end
110
+ end
111
+
112
+ # source://mocktail//lib/mocktail/sorbet/mocktail/errors.rb#12
113
+ class Mocktail::AmbiguousDemonstrationError < ::Mocktail::Error; end
114
+
115
+ # source://mocktail//lib/mocktail/sorbet/mocktail.rb#44
116
+ Mocktail::BASE_PATH = T.let(T.unsafe(nil), String)
117
+
118
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/bind.rb#4
119
+ module Mocktail::Bind
120
+ class << self
121
+ # sig intentionally omitted, because the wrapper will cause infinite recursion if certain methods are mocked
122
+ #
123
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/bind.rb#6
124
+ def call(mock, method_name, *args, **kwargs, &blk); end
125
+ end
126
+ end
127
+
128
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#8
129
+ class Mocktail::Cabinet
130
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#24
131
+ sig { void }
132
+ def initialize; end
133
+
134
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#15
135
+ sig { returns(T::Array[::Mocktail::Call]) }
136
+ def calls; end
137
+
138
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#85
139
+ sig { params(double: ::Mocktail::Double).returns(T::Array[::Mocktail::Call]) }
140
+ def calls_for_double(double); end
141
+
142
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#12
143
+ sig { params(demonstration_in_progress: T::Boolean).void }
144
+ def demonstration_in_progress=(demonstration_in_progress); end
145
+
146
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#65
147
+ sig { returns(T::Boolean) }
148
+ def demonstration_in_progress?; end
149
+
150
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#70
151
+ sig { params(thing: T.anything).returns(T.nilable(::Mocktail::Double)) }
152
+ def double_for_instance(thing); end
153
+
154
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#33
155
+ sig { void }
156
+ def reset!; end
157
+
158
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#50
159
+ sig { params(call: ::Mocktail::Call).void }
160
+ def store_call(call); end
161
+
162
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#45
163
+ sig { params(double: ::Mocktail::Double).void }
164
+ def store_double(double); end
165
+
166
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#55
167
+ sig { params(stubbing: Mocktail::Stubbing[T.anything]).void }
168
+ def store_stubbing(stubbing); end
169
+
170
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#60
171
+ sig { params(unsatisfying_call: ::Mocktail::UnsatisfyingCall).void }
172
+ def store_unsatisfying_call(unsatisfying_call); end
173
+
174
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#18
175
+ sig { returns(T::Array[Mocktail::Stubbing[T.anything]]) }
176
+ def stubbings; end
177
+
178
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#78
179
+ sig { params(double: ::Mocktail::Double).returns(T::Array[Mocktail::Stubbing[T.anything]]) }
180
+ def stubbings_for_double(double); end
181
+
182
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/cabinet.rb#21
183
+ sig { returns(T::Array[::Mocktail::UnsatisfyingCall]) }
184
+ def unsatisfying_calls; end
185
+ end
186
+
187
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/call.rb#4
188
+ class Mocktail::Call < ::T::Struct
189
+ const :singleton, T.nilable(T::Boolean)
190
+ const :double, ::Object, default: T.unsafe(nil)
191
+ const :original_type, T.nilable(T.any(::Module, T::Class[T.anything]))
192
+ const :dry_type, T.nilable(T.any(::Module, T::Class[T.anything]))
193
+ const :method, T.nilable(::Symbol)
194
+ const :original_method, T.nilable(T.any(::Method, ::UnboundMethod))
195
+ const :args, T::Array[T.untyped], default: T.unsafe(nil)
196
+ const :kwargs, T::Hash[::Symbol, T.untyped], default: T.unsafe(nil)
197
+ const :block, T.nilable(::Proc)
198
+
199
+ # Because T::Struct compares with referential equality, we need
200
+ # to redefine the equality methods to compare the values of the attributes.
201
+ #
202
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/call.rb#27
203
+ sig { params(other: T.nilable(T.anything)).returns(T::Boolean) }
204
+ def ==(other); end
205
+
206
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/call.rb#32
207
+ sig { params(other: T.anything).returns(T::Boolean) }
208
+ def eql?(other); end
209
+
210
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/call.rb#47
211
+ sig { returns(::Integer) }
212
+ def hash; end
213
+
214
+ class << self
215
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
216
+ def inherited(s); end
217
+ end
218
+ end
219
+
220
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/cleans_backtrace.rb#4
221
+ class Mocktail::CleansBacktrace
222
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/cleans_backtrace.rb#12
223
+ sig { type_parameters(:T).params(error: T.all(::StandardError, T.type_parameter(:T))).returns(T.type_parameter(:T)) }
224
+ def clean(error); end
225
+ end
226
+
227
+ # source://mocktail//lib/mocktail/sorbet/mocktail/collects_calls.rb#4
228
+ class Mocktail::CollectsCalls
229
+ # source://mocktail//lib/mocktail/sorbet/mocktail/collects_calls.rb#8
230
+ sig { params(double: ::Object, method_name: T.nilable(::Symbol)).returns(T::Array[::Mocktail::Call]) }
231
+ def collect(double, method_name); end
232
+ end
233
+
234
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/creates_identifier.rb#4
235
+ class Mocktail::CreatesIdentifier
236
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/creates_identifier.rb#10
237
+ sig { params(s: T.anything, default: ::String, max_length: ::Integer).returns(::String) }
238
+ def create(s, default: T.unsafe(nil), max_length: T.unsafe(nil)); end
239
+
240
+ private
241
+
242
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/creates_identifier.rb#33
243
+ sig { params(id: ::String, default: ::String).returns(::String) }
244
+ def unreserved(id, default); end
245
+ end
246
+
247
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/creates_identifier.rb#7
248
+ Mocktail::CreatesIdentifier::KEYWORDS = T.let(T.unsafe(nil), Array)
249
+
250
+ # source://mocktail//lib/mocktail/sorbet/mocktail/dsl.rb#4
251
+ module Mocktail::DSL
252
+ # source://mocktail//lib/mocktail/sorbet/mocktail/dsl.rb#18
253
+ sig do
254
+ type_parameters(:T)
255
+ .params(
256
+ ignore_block: T::Boolean,
257
+ ignore_extra_args: T::Boolean,
258
+ ignore_arity: T::Boolean,
259
+ times: T.nilable(::Integer),
260
+ demo: T.proc.params(matchers: ::Mocktail::MatcherPresentation).returns(T.type_parameter(:T))
261
+ ).returns(Mocktail::Stubbing[T.type_parameter(:T)])
262
+ end
263
+ def stubs(ignore_block: T.unsafe(nil), ignore_extra_args: T.unsafe(nil), ignore_arity: T.unsafe(nil), times: T.unsafe(nil), &demo); end
264
+
265
+ # source://mocktail//lib/mocktail/sorbet/mocktail/dsl.rb#37
266
+ sig do
267
+ params(
268
+ ignore_block: T::Boolean,
269
+ ignore_extra_args: T::Boolean,
270
+ ignore_arity: T::Boolean,
271
+ times: T.nilable(::Integer),
272
+ demo: T.proc.params(matchers: ::Mocktail::MatcherPresentation).void
273
+ ).void
274
+ end
275
+ def verify(ignore_block: T.unsafe(nil), ignore_extra_args: T.unsafe(nil), ignore_arity: T.unsafe(nil), times: T.unsafe(nil), &demo); end
276
+ end
277
+
278
+ # source://mocktail//lib/mocktail/sorbet/mocktail/debug.rb#4
279
+ module Mocktail::Debug
280
+ class << self
281
+ # It would be easy and bad for the mocktail lib to call something like
282
+ #
283
+ # double == other_double
284
+ #
285
+ # But if it's a double, that means anyone who stubs that method could change
286
+ # the internal behavior of the library in unexpected ways (as happened here:
287
+ # https://github.com/testdouble/mocktail/issues/7 )
288
+ #
289
+ # For that reason when we run our tests, we also want to blow up if this
290
+ # happens unintentionally. This works in conjunction with the test
291
+ # MockingMethodfulClassesTest, because it mocks every defined method on the
292
+ # mocked BasicObject
293
+ #
294
+ # source://mocktail//lib/mocktail/sorbet/mocktail/debug.rb#20
295
+ sig { void }
296
+ def guard_against_mocktail_accidentally_calling_mocks_if_debugging!; end
297
+ end
298
+ end
299
+
300
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb#6
301
+ class Mocktail::DeclaresDryClass
302
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb#12
303
+ sig { void }
304
+ def initialize; end
305
+
306
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb#23
307
+ sig do
308
+ type_parameters(:T)
309
+ .params(
310
+ type: T.all(T.type_parameter(:T), T::Class[::Object]),
311
+ instance_methods: T::Array[::Symbol]
312
+ ).returns(T.type_parameter(:T))
313
+ end
314
+ def declare(type, instance_methods); end
315
+
316
+ private
317
+
318
+ # These have special implementations, but if the user defines
319
+ # any of them on the object itself, then they'll be replaced with normal
320
+ # mocked methods. YMMV
321
+ #
322
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb#55
323
+ sig do
324
+ params(
325
+ dry_class: T::Class[::Object],
326
+ type: T.any(::Module, T::Class[T.anything]),
327
+ instance_methods: T::Array[::Symbol]
328
+ ).void
329
+ end
330
+ def add_more_methods!(dry_class, type, instance_methods); end
331
+
332
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb#94
333
+ sig do
334
+ params(
335
+ dry_class: T::Class[::Object],
336
+ method_name: ::Symbol,
337
+ type: T.any(::Module, T::Class[T.anything]),
338
+ instance_methods: T::Array[::Symbol]
339
+ ).void
340
+ end
341
+ def add_stringify_methods!(dry_class, method_name, type, instance_methods); end
342
+
343
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb#64
344
+ sig do
345
+ params(
346
+ dry_class: T::Class[::Object],
347
+ type: T.any(::Module, T::Class[T.anything]),
348
+ instance_methods: T::Array[::Symbol]
349
+ ).void
350
+ end
351
+ def define_double_methods!(dry_class, type, instance_methods); end
352
+
353
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb#115
354
+ sig do
355
+ params(
356
+ dry_class: T::Class[::Object],
357
+ type: T.any(::Module, T::Class[T.anything]),
358
+ instance_methods: T::Array[::Symbol]
359
+ ).void
360
+ end
361
+ def define_method_missing_errors!(dry_class, type, instance_methods); end
362
+ end
363
+
364
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class.rb#9
365
+ Mocktail::DeclaresDryClass::DEFAULT_ANCESTORS = T.let(T.unsafe(nil), Array)
366
+
367
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/demo_config.rb#4
368
+ class Mocktail::DemoConfig < ::T::Struct
369
+ const :ignore_block, T::Boolean, default: T.unsafe(nil)
370
+ const :ignore_extra_args, T::Boolean, default: T.unsafe(nil)
371
+ const :ignore_arity, T::Boolean, default: T.unsafe(nil)
372
+ const :times, T.nilable(::Integer), default: T.unsafe(nil)
373
+
374
+ class << self
375
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
376
+ def inherited(s); end
377
+ end
378
+ end
379
+
380
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing/describes_unsatisfied_stubbing.rb#7
381
+ class Mocktail::DescribesUnsatisfiedStubbing
382
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing/describes_unsatisfied_stubbing.rb#11
383
+ sig { void }
384
+ def initialize; end
385
+
386
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing/describes_unsatisfied_stubbing.rb#16
387
+ sig { params(dry_call: ::Mocktail::Call).returns(::Mocktail::UnsatisfyingCall) }
388
+ def describe(dry_call); end
389
+ end
390
+
391
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/determines_matching_calls.rb#6
392
+ class Mocktail::DeterminesMatchingCalls
393
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/determines_matching_calls.rb#10
394
+ sig do
395
+ params(
396
+ real_call: ::Mocktail::Call,
397
+ demo_call: ::Mocktail::Call,
398
+ demo_config: ::Mocktail::DemoConfig
399
+ ).returns(T::Boolean)
400
+ end
401
+ def determine(real_call, demo_call, demo_config); end
402
+
403
+ private
404
+
405
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/determines_matching_calls.rb#23
406
+ sig do
407
+ params(
408
+ real_args: T::Array[T.untyped],
409
+ demo_args: T::Array[T.untyped],
410
+ ignore_extra_args: T::Boolean
411
+ ).returns(T::Boolean)
412
+ end
413
+ def args_match?(real_args, demo_args, ignore_extra_args); end
414
+
415
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/determines_matching_calls.rb#50
416
+ sig do
417
+ params(
418
+ real_block: T.nilable(::Proc),
419
+ demo_block: T.nilable(::Proc),
420
+ ignore_block: T::Boolean
421
+ ).returns(T::Boolean)
422
+ end
423
+ def blocks_match?(real_block, demo_block, ignore_block); end
424
+
425
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/determines_matching_calls.rb#37
426
+ sig do
427
+ params(
428
+ real_kwargs: T::Hash[::Symbol, T.untyped],
429
+ demo_kwargs: T::Hash[::Symbol, T.untyped],
430
+ ignore_extra_args: T::Boolean
431
+ ).returns(T::Boolean)
432
+ end
433
+ def kwargs_match?(real_kwargs, demo_kwargs, ignore_extra_args); end
434
+
435
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/determines_matching_calls.rb#63
436
+ sig { params(real_arg: T.untyped, demo_arg: T.untyped).returns(T::Boolean) }
437
+ def match?(real_arg, demo_arg); end
438
+ end
439
+
440
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/double.rb#4
441
+ class Mocktail::Double < ::T::Struct
442
+ const :original_type, T.any(::Module, T::Class[T.anything])
443
+ const :dry_type, T::Class[T.anything]
444
+ const :dry_instance, ::Object
445
+ const :dry_methods, T::Array[::Symbol]
446
+
447
+ class << self
448
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
449
+ def inherited(s); end
450
+ end
451
+ end
452
+
453
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/double_data.rb#7
454
+ class Mocktail::DoubleData < ::T::Struct
455
+ include ::Mocktail::ExplanationData
456
+
457
+ const :type, T.any(::Module, T::Class[T.anything])
458
+ const :double, ::Object
459
+ const :calls, T::Array[::Mocktail::Call]
460
+ const :stubbings, T::Array[Mocktail::Stubbing[T.anything]]
461
+
462
+ class << self
463
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
464
+ def inherited(s); end
465
+ end
466
+ end
467
+
468
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#36
469
+ class Mocktail::DoubleExplanation < ::Mocktail::Explanation
470
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#41
471
+ sig { params(reference: ::Mocktail::DoubleData, message: ::String).void }
472
+ def initialize(reference, message); end
473
+
474
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#38
475
+ sig { override.returns(::Mocktail::DoubleData) }
476
+ def reference; end
477
+ end
478
+
479
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/ensures_imitation_support.rb#4
480
+ class Mocktail::EnsuresImitationSupport
481
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/ensures_imitation_support.rb#8
482
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
483
+ def ensure(type); end
484
+ end
485
+
486
+ # source://mocktail//lib/mocktail/sorbet/mocktail/errors.rb#4
487
+ class Mocktail::Error < ::StandardError; end
488
+
489
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_nils.rb#7
490
+ class Mocktail::ExplainsNils
491
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_nils.rb#11
492
+ sig { void }
493
+ def initialize; end
494
+
495
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_nils.rb#17
496
+ sig { returns(T::Array[::Mocktail::UnsatisfyingCallExplanation]) }
497
+ def explain; end
498
+ end
499
+
500
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#7
501
+ class Mocktail::ExplainsThing
502
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#11
503
+ sig { void }
504
+ def initialize; end
505
+
506
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#17
507
+ sig { params(thing: ::Object).returns(::Mocktail::Explanation) }
508
+ def explain(thing); end
509
+
510
+ private
511
+
512
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#54
513
+ sig { params(double: ::Mocktail::Double).returns(::Mocktail::DoubleData) }
514
+ def data_for_double(double); end
515
+
516
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#78
517
+ sig { params(type_replacement: ::Mocktail::TypeReplacement).returns(::Mocktail::TypeReplacementData) }
518
+ def data_for_type_replacement(type_replacement); end
519
+
520
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#106
521
+ sig do
522
+ params(
523
+ double_data: T.any(::Mocktail::DoubleData, ::Mocktail::TypeReplacementData),
524
+ method: ::Symbol
525
+ ).returns(::String)
526
+ end
527
+ def describe_dry_method(double_data, method); end
528
+
529
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#64
530
+ sig { params(double: ::Mocktail::Double).returns(::Mocktail::DoubleExplanation) }
531
+ def double_explanation(double); end
532
+
533
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#33
534
+ sig { params(thing: ::Object).returns(T.nilable(::Mocktail::FakeMethodExplanation)) }
535
+ def fake_method_explanation_for(thing); end
536
+
537
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#132
538
+ sig { params(thing: ::Object).returns(::Mocktail::NoExplanation) }
539
+ def no_explanation(thing); end
540
+
541
+ # source://mocktail//lib/mocktail/sorbet/mocktail/explains_thing.rb#92
542
+ sig { params(type_replacement: ::Mocktail::TypeReplacement).returns(::Mocktail::ReplacedTypeExplanation) }
543
+ def replaced_type_explanation(type_replacement); end
544
+ end
545
+
546
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#4
547
+ class Mocktail::Explanation
548
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#14
549
+ sig { params(reference: ::Mocktail::ExplanationData, message: ::String).void }
550
+ def initialize(reference, message); end
551
+
552
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#11
553
+ sig { returns(::String) }
554
+ def message; end
555
+
556
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#8
557
+ sig { returns(::Mocktail::ExplanationData) }
558
+ def reference; end
559
+
560
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#20
561
+ sig { returns(T.class_of(Mocktail::Explanation)) }
562
+ def type; end
563
+ end
564
+
565
+ # @abstract Subclasses must implement the `abstract` methods below.
566
+ #
567
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation_data.rb#4
568
+ module Mocktail::ExplanationData
569
+ include ::Kernel
570
+
571
+ interface!
572
+
573
+ # @abstract
574
+ #
575
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation_data.rb#12
576
+ sig { abstract.returns(T::Array[::Mocktail::Call]) }
577
+ def calls; end
578
+
579
+ # @abstract
580
+ #
581
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation_data.rb#16
582
+ sig { abstract.returns(T::Array[Mocktail::Stubbing[T.anything]]) }
583
+ def stubbings; end
584
+ end
585
+
586
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/fake_method_data.rb#4
587
+ class Mocktail::FakeMethodData < ::T::Struct
588
+ include ::Mocktail::ExplanationData
589
+
590
+ const :receiver, T.anything
591
+ const :calls, T::Array[::Mocktail::Call]
592
+ const :stubbings, T::Array[Mocktail::Stubbing[T.anything]]
593
+
594
+ class << self
595
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
596
+ def inherited(s); end
597
+ end
598
+ end
599
+
600
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#58
601
+ class Mocktail::FakeMethodExplanation < ::Mocktail::Explanation
602
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#63
603
+ sig { params(reference: ::Mocktail::FakeMethodData, message: ::String).void }
604
+ def initialize(reference, message); end
605
+
606
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#60
607
+ sig { override.returns(::Mocktail::FakeMethodData) }
608
+ def reference; end
609
+ end
610
+
611
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing/finds_satisfaction.rb#6
612
+ class Mocktail::FindsSatisfaction
613
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing/finds_satisfaction.rb#10
614
+ sig { void }
615
+ def initialize; end
616
+
617
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing/finds_satisfaction.rb#15
618
+ sig { params(dry_call: ::Mocktail::Call).returns(T.nilable(Mocktail::Stubbing[T.anything])) }
619
+ def find(dry_call); end
620
+ end
621
+
622
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/finds_verifiable_calls.rb#6
623
+ class Mocktail::FindsVerifiableCalls
624
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/finds_verifiable_calls.rb#10
625
+ sig { void }
626
+ def initialize; end
627
+
628
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/finds_verifiable_calls.rb#15
629
+ sig { params(recording: ::Mocktail::Call, demo_config: ::Mocktail::DemoConfig).returns(T::Array[::Mocktail::Call]) }
630
+ def find(recording, demo_config); end
631
+ end
632
+
633
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing.rb#7
634
+ class Mocktail::FulfillsStubbing
635
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing.rb#11
636
+ sig { void }
637
+ def initialize; end
638
+
639
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing.rb#17
640
+ sig { params(dry_call: ::Mocktail::Call).returns(T.anything) }
641
+ def fulfill(dry_call); end
642
+
643
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing.rb#28
644
+ sig { params(dry_call: ::Mocktail::Call).returns(T.nilable(Mocktail::Stubbing[T.anything])) }
645
+ def satisfaction(dry_call); end
646
+
647
+ private
648
+
649
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing.rb#37
650
+ sig { params(dry_call: ::Mocktail::Call).void }
651
+ def store_unsatisfying_call!(dry_call); end
652
+ end
653
+
654
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error/gathers_calls_of_method.rb#4
655
+ class Mocktail::GathersCallsOfMethod
656
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error/gathers_calls_of_method.rb#8
657
+ sig { params(dry_call: ::Mocktail::Call).returns(T::Array[::Mocktail::Call]) }
658
+ def gather(dry_call); end
659
+ end
660
+
661
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/gathers_fakeable_instance_methods.rb#4
662
+ class Mocktail::GathersFakeableInstanceMethods
663
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/gathers_fakeable_instance_methods.rb#8
664
+ sig { params(type: T.any(::Module, T::Class[T.anything])).returns(T::Array[::Symbol]) }
665
+ def gather(type); end
666
+
667
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/gathers_fakeable_instance_methods.rb#19
668
+ sig { params(type: T.any(::Module, T::Class[T.anything]), method_name: ::Symbol).returns(T::Boolean) }
669
+ def ignore?(type, method_name); end
670
+
671
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/gathers_fakeable_instance_methods.rb#24
672
+ sig { returns(T::Array[::Module]) }
673
+ def ignored_ancestors; end
674
+ end
675
+
676
+ # source://mocktail//lib/mocktail/sorbet/mocktail/grabs_original_method_parameters.rb#4
677
+ class Mocktail::GrabsOriginalMethodParameters
678
+ # Sorbet wraps the original method in a sig wrapper, so we need to unwrap it.
679
+ # The value returned from `owner.instance_method(method_name)` does not have
680
+ # the real parameters values available, as they'll have been erased
681
+ #
682
+ # If the method isn't wrapped by Sorbet, this will return the #instance_method,
683
+ # per usual
684
+ #
685
+ # source://mocktail//lib/mocktail/sorbet/mocktail/grabs_original_method_parameters.rb#14
686
+ sig { params(method: T.nilable(T.any(::Method, ::UnboundMethod))).returns(T::Array[T::Array[::Symbol]]) }
687
+ def grab(method); end
688
+
689
+ private
690
+
691
+ # source://mocktail//lib/mocktail/sorbet/mocktail/grabs_original_method_parameters.rb#27
692
+ sig { params(method: T.any(::Method, ::UnboundMethod)).returns(T.nilable(::T::Private::Methods::Signature)) }
693
+ def sorbet_wrapped_method(method); end
694
+ end
695
+
696
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call.rb#8
697
+ class Mocktail::HandlesDryCall
698
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call.rb#12
699
+ sig { void }
700
+ def initialize; end
701
+
702
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call.rb#19
703
+ sig { params(dry_call: ::Mocktail::Call).returns(T.anything) }
704
+ def handle(dry_call); end
705
+ end
706
+
707
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_new_call.rb#4
708
+ class Mocktail::HandlesDryNewCall
709
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_new_call.rb#8
710
+ sig { void }
711
+ def initialize; end
712
+
713
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_new_call.rb#16
714
+ sig do
715
+ params(
716
+ type: T::Class[T.all(::Object, ::T)],
717
+ args: T::Array[T.anything],
718
+ kwargs: T::Hash[::Symbol, T.anything],
719
+ block: T.nilable(::Proc)
720
+ ).returns(T.anything)
721
+ end
722
+ def handle(type, args, kwargs, block); end
723
+ end
724
+
725
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type.rb#7
726
+ class Mocktail::ImitatesType
727
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type.rb#12
728
+ sig { void }
729
+ def initialize; end
730
+
731
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type.rb#22
732
+ sig do
733
+ type_parameters(:T)
734
+ .params(
735
+ type: T::Class[T.all(::Object, T.type_parameter(:T))]
736
+ ).returns(T.all(::Object, T.type_parameter(:T)))
737
+ end
738
+ def imitate(type); end
739
+ end
740
+
741
+ # source://mocktail//lib/mocktail/sorbet/mocktail/initializes_mocktail.rb#4
742
+ class Mocktail::InitializesMocktail
743
+ # source://mocktail//lib/mocktail/sorbet/mocktail/initializes_mocktail.rb#8
744
+ sig { void }
745
+ def init; end
746
+ end
747
+
748
+ # source://mocktail//lib/mocktail/sorbet/mocktail/errors.rb#14
749
+ class Mocktail::InvalidMatcherError < ::Mocktail::Error; end
750
+
751
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/logs_call.rb#4
752
+ class Mocktail::LogsCall
753
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/logs_call.rb#8
754
+ sig { params(dry_call: ::Mocktail::Call).void }
755
+ def log(dry_call); end
756
+ end
757
+
758
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double.rb#7
759
+ class Mocktail::MakesDouble
760
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double.rb#11
761
+ sig { void }
762
+ def initialize; end
763
+
764
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double.rb#17
765
+ sig { params(type: T::Class[::Object]).returns(::Mocktail::Double) }
766
+ def make(type); end
767
+ end
768
+
769
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matcher_presentation.rb#4
770
+ class Mocktail::MatcherPresentation
771
+ sig { returns(T.untyped) }
772
+ def any; end
773
+
774
+ sig { type_parameters(:T).params(expecteds: T.type_parameter(:T)).returns(T::Array[T.type_parameter(:T)]) }
775
+ def includes(*expecteds); end
776
+
777
+ sig do
778
+ type_parameters(:K, :V)
779
+ .params(
780
+ expecteds: T::Hash[T.type_parameter(:K), T.type_parameter(:V)]
781
+ ).returns(T::Hash[T.type_parameter(:K), T.type_parameter(:V)])
782
+ end
783
+ def includes_hash(*expecteds); end
784
+
785
+ sig do
786
+ type_parameters(:K, :V)
787
+ .params(
788
+ expecteds: T.type_parameter(:K)
789
+ ).returns(T::Hash[T.type_parameter(:K), T.type_parameter(:V)])
790
+ end
791
+ def includes_key(*expecteds); end
792
+
793
+ sig { type_parameters(:T).params(expecteds: T.type_parameter(:T)).returns(T.type_parameter(:T)) }
794
+ def includes_string(*expecteds); end
795
+
796
+ sig { type_parameters(:T).params(expected: T::Class[T.type_parameter(:T)]).returns(T.type_parameter(:T)) }
797
+ def is_a(expected); end
798
+
799
+ sig { params(pattern: T.any(String, Regexp)).returns(String) }
800
+ def matches(pattern); end
801
+
802
+ # standard:disable Style/ArgumentsForwarding
803
+ #
804
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matcher_presentation.rb#13
805
+ sig { params(name: ::Symbol, args: T.anything, kwargs: T.anything, blk: T.nilable(::Proc)).returns(T.anything) }
806
+ def method_missing(name, *args, **kwargs, &blk); end
807
+
808
+ sig { type_parameters(:T).params(unexpected: T.type_parameter(:T)).returns(T.type_parameter(:T)) }
809
+ def not(unexpected); end
810
+
811
+ sig { returns(T.untyped) }
812
+ def numeric; end
813
+
814
+ sig { params(blk: T.proc.params(arg: T.untyped).returns(T::Boolean)).returns(T.untyped) }
815
+ def that(&blk); end
816
+
817
+ private
818
+
819
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matcher_presentation.rb#8
820
+ sig { params(name: ::Symbol, include_private: T::Boolean).returns(T::Boolean) }
821
+ def respond_to_missing?(name, include_private = T.unsafe(nil)); end
822
+ end
823
+
824
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/matcher_registry.rb#4
825
+ class Mocktail::MatcherRegistry
826
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/matcher_registry.rb#13
827
+ sig { void }
828
+ def initialize; end
829
+
830
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/matcher_registry.rb#18
831
+ sig { params(matcher_type: T.class_of(Mocktail::Matchers::Base)).void }
832
+ def add(matcher_type); end
833
+
834
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/matcher_registry.rb#23
835
+ sig { params(name: ::Symbol).returns(T.nilable(T.class_of(Mocktail::Matchers::Base))) }
836
+ def get(name); end
837
+
838
+ class << self
839
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/matcher_registry.rb#8
840
+ sig { returns(::Mocktail::MatcherRegistry) }
841
+ def instance; end
842
+ end
843
+ end
844
+
845
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers.rb#4
846
+ module Mocktail::Matchers; end
847
+
848
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/any.rb#4
849
+ class Mocktail::Matchers::Any < ::Mocktail::Matchers::Base
850
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/any.rb#13
851
+ sig { void }
852
+ def initialize; end
853
+
854
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/any.rb#23
855
+ sig { returns(::String) }
856
+ def inspect; end
857
+
858
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/any.rb#18
859
+ sig { params(actual: T.anything).returns(T::Boolean) }
860
+ def match?(actual); end
861
+
862
+ class << self
863
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/any.rb#8
864
+ sig { returns(::Symbol) }
865
+ def matcher_name; end
866
+ end
867
+ end
868
+
869
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
870
+ #
871
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/base.rb#4
872
+ class Mocktail::Matchers::Base
873
+ # Custom matchers can receive any args, kwargs, or block they want. Usually
874
+ # single-argument, though, so that's defaulted here and in #insepct
875
+ #
876
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/base.rb#15
877
+ sig { params(expected: ::BasicObject).void }
878
+ def initialize(expected); end
879
+
880
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/base.rb#30
881
+ sig { returns(::String) }
882
+ def inspect; end
883
+
884
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/base.rb#35
885
+ sig { returns(::TrueClass) }
886
+ def is_mocktail_matcher?; end
887
+
888
+ # @raise [Mocktail::InvalidMatcherError]
889
+ #
890
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/base.rb#25
891
+ sig { params(actual: T.untyped).returns(T::Boolean) }
892
+ def match?(actual); end
893
+
894
+ class << self
895
+ # @raise [Mocktail::InvalidMatcherError]
896
+ #
897
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/base.rb#20
898
+ sig { returns(::Symbol) }
899
+ def matcher_name; end
900
+ end
901
+ end
902
+
903
+ # Captors are conceptually complex implementations, but with a simple usage/purpose:
904
+ # They are values the user can create and hold onto that will return a matcher
905
+ # and then "capture" the value made by the real call, for later analysis & assertion.
906
+ #
907
+ # Unlike other matchers, these don't make any useful sense for stubbing, but are
908
+ # very useful when asserting complication call verifications
909
+ #
910
+ # The fact the user will need the reference outside the verification call is
911
+ # why this is a top-level method on Mocktail, and not included in the |m| block
912
+ # arg to stubs/verify
913
+ #
914
+ # See Mockito, which is the earliest implementation I know of:
915
+ # https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Captor.html
916
+ #
917
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#17
918
+ # Captors are conceptually complex implementations, but with a simple usage/purpose:
919
+ # They are values the user can create and hold onto that will return a matcher
920
+ # and then "capture" the value made by the real call, for later analysis & assertion.
921
+ # Unlike other matchers, these don't make any useful sense for stubbing, but are
922
+ # very useful when asserting complication call verifications
923
+ # The fact the user will need the reference outside the verification call is
924
+ # why this is a top-level method on Mocktail, and not included in the |m| block
925
+ # arg to stubs/verify
926
+ # See Mockito, which is the earliest implementation I know of:
927
+ class Mocktail::Matchers::Captor
928
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#62
929
+ sig { void }
930
+ def initialize; end
931
+
932
+ # This T.untyped is intentional. Even though a Capture is surely returned,
933
+ # in order for a verification demonstration to pass its own type check,
934
+ # it needs to think it's being returned whatever parameter is expected
935
+ #
936
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#59
937
+ sig { returns(T.untyped) }
938
+ def capture; end
939
+
940
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#67
941
+ sig { returns(T::Boolean) }
942
+ def captured?; end
943
+
944
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#72
945
+ sig { returns(T.untyped) }
946
+ def value; end
947
+ end
948
+
949
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#20
950
+ class Mocktail::Matchers::Captor::Capture < ::Mocktail::Matchers::Base
951
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#32
952
+ sig { void }
953
+ def initialize; end
954
+
955
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#45
956
+ sig { returns(T::Boolean) }
957
+ def captured?; end
958
+
959
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#50
960
+ sig { returns(::String) }
961
+ def inspect; end
962
+
963
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#38
964
+ sig { params(actual: T.untyped).returns(::TrueClass) }
965
+ def match?(actual); end
966
+
967
+ # Returns the value of attribute value.
968
+ #
969
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#29
970
+ sig { returns(T.untyped) }
971
+ def value; end
972
+
973
+ class << self
974
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/captor.rb#24
975
+ sig { returns(::Symbol) }
976
+ def matcher_name; end
977
+ end
978
+ end
979
+
980
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes.rb#4
981
+ class Mocktail::Matchers::Includes < ::Mocktail::Matchers::Base
982
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes.rb#13
983
+ sig { params(expecteds: T.untyped).void }
984
+ def initialize(*expecteds); end
985
+
986
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes.rb#28
987
+ sig { returns(::String) }
988
+ def inspect; end
989
+
990
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes.rb#18
991
+ sig { params(actual: T.untyped).returns(T::Boolean) }
992
+ def match?(actual); end
993
+
994
+ class << self
995
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes.rb#8
996
+ sig { returns(::Symbol) }
997
+ def matcher_name; end
998
+ end
999
+ end
1000
+
1001
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes_hash.rb#4
1002
+ class Mocktail::Matchers::IncludesHash < ::Mocktail::Matchers::Includes
1003
+ class << self
1004
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes_hash.rb#8
1005
+ sig { returns(::Symbol) }
1006
+ def matcher_name; end
1007
+ end
1008
+ end
1009
+
1010
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes_key.rb#4
1011
+ class Mocktail::Matchers::IncludesKey < ::Mocktail::Matchers::Includes
1012
+ class << self
1013
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes_key.rb#8
1014
+ sig { returns(::Symbol) }
1015
+ def matcher_name; end
1016
+ end
1017
+ end
1018
+
1019
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes_string.rb#4
1020
+ class Mocktail::Matchers::IncludesString < ::Mocktail::Matchers::Includes
1021
+ class << self
1022
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/includes_string.rb#8
1023
+ sig { returns(::Symbol) }
1024
+ def matcher_name; end
1025
+ end
1026
+ end
1027
+
1028
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/is_a.rb#4
1029
+ class Mocktail::Matchers::IsA < ::Mocktail::Matchers::Base
1030
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/is_a.rb#13
1031
+ sig { params(actual: T.untyped).returns(T::Boolean) }
1032
+ def match?(actual); end
1033
+
1034
+ class << self
1035
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/is_a.rb#8
1036
+ sig { returns(::Symbol) }
1037
+ def matcher_name; end
1038
+ end
1039
+ end
1040
+
1041
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/matches.rb#4
1042
+ class Mocktail::Matchers::Matches < ::Mocktail::Matchers::Base
1043
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/matches.rb#13
1044
+ sig { params(actual: T.untyped).returns(T::Boolean) }
1045
+ def match?(actual); end
1046
+
1047
+ class << self
1048
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/matches.rb#8
1049
+ sig { returns(::Symbol) }
1050
+ def matcher_name; end
1051
+ end
1052
+ end
1053
+
1054
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/not.rb#4
1055
+ class Mocktail::Matchers::Not < ::Mocktail::Matchers::Base
1056
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/not.rb#13
1057
+ sig { params(actual: T.untyped).returns(T::Boolean) }
1058
+ def match?(actual); end
1059
+
1060
+ class << self
1061
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/not.rb#8
1062
+ sig { returns(::Symbol) }
1063
+ def matcher_name; end
1064
+ end
1065
+ end
1066
+
1067
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/numeric.rb#4
1068
+ class Mocktail::Matchers::Numeric < ::Mocktail::Matchers::Base
1069
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/numeric.rb#13
1070
+ sig { void }
1071
+ def initialize; end
1072
+
1073
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/numeric.rb#23
1074
+ sig { returns(::String) }
1075
+ def inspect; end
1076
+
1077
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/numeric.rb#18
1078
+ sig { params(actual: T.untyped).returns(T::Boolean) }
1079
+ def match?(actual); end
1080
+
1081
+ class << self
1082
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/numeric.rb#8
1083
+ sig { returns(::Symbol) }
1084
+ def matcher_name; end
1085
+ end
1086
+ end
1087
+
1088
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/that.rb#4
1089
+ class Mocktail::Matchers::That < ::Mocktail::Matchers::Base
1090
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/that.rb#13
1091
+ sig { params(blk: T.nilable(T.proc.params(actual: T.untyped).returns(T.untyped))).void }
1092
+ def initialize(&blk); end
1093
+
1094
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/that.rb#28
1095
+ sig { returns(::String) }
1096
+ def inspect; end
1097
+
1098
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/that.rb#21
1099
+ sig { params(actual: T.untyped).returns(T::Boolean) }
1100
+ def match?(actual); end
1101
+
1102
+ class << self
1103
+ # source://mocktail//lib/mocktail/sorbet/mocktail/matchers/that.rb#8
1104
+ sig { returns(::Symbol) }
1105
+ def matcher_name; end
1106
+ end
1107
+ end
1108
+
1109
+ # source://mocktail//lib/mocktail/sorbet/mocktail/errors.rb#10
1110
+ class Mocktail::MissingDemonstrationError < ::Mocktail::Error; end
1111
+
1112
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#25
1113
+ class Mocktail::NoExplanation < ::Mocktail::Explanation
1114
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#30
1115
+ sig { params(reference: ::Mocktail::NoExplanationData, message: ::String).void }
1116
+ def initialize(reference, message); end
1117
+
1118
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#27
1119
+ sig { override.returns(::Mocktail::NoExplanationData) }
1120
+ def reference; end
1121
+ end
1122
+
1123
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/no_explanation_data.rb#4
1124
+ class Mocktail::NoExplanationData < ::T::Struct
1125
+ include ::Mocktail::ExplanationData
1126
+
1127
+ const :thing, ::Object
1128
+
1129
+ # @raise [Error]
1130
+ #
1131
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/no_explanation_data.rb#11
1132
+ sig { override.returns(T::Array[::Mocktail::Call]) }
1133
+ def calls; end
1134
+
1135
+ # @raise [Error]
1136
+ #
1137
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/no_explanation_data.rb#16
1138
+ sig { override.returns(T::Array[Mocktail::Stubbing[T.anything]]) }
1139
+ def stubbings; end
1140
+
1141
+ class << self
1142
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
1143
+ def inherited(s); end
1144
+ end
1145
+ end
1146
+
1147
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/signature.rb#4
1148
+ class Mocktail::Params < ::T::Struct
1149
+ prop :all, T::Array[::Symbol], default: T.unsafe(nil)
1150
+ prop :required, T::Array[::Symbol], default: T.unsafe(nil)
1151
+ prop :optional, T::Array[::Symbol], default: T.unsafe(nil)
1152
+ prop :rest, T.nilable(::Symbol)
1153
+
1154
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/signature.rb#13
1155
+ sig { returns(T::Array[::Symbol]) }
1156
+ def allowed; end
1157
+
1158
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/signature.rb#18
1159
+ sig { returns(T::Boolean) }
1160
+ def rest?; end
1161
+
1162
+ class << self
1163
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
1164
+ def inherited(s); end
1165
+ end
1166
+ end
1167
+
1168
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#8
1169
+ class Mocktail::RaisesNeatoNoMethodError
1170
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#12
1171
+ sig { void }
1172
+ def initialize; end
1173
+
1174
+ # @raise [NoMethodError]
1175
+ #
1176
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#19
1177
+ sig { params(call: ::Mocktail::Call).void }
1178
+ def call(call); end
1179
+
1180
+ private
1181
+
1182
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#63
1183
+ sig { params(block: T.nilable(::Proc)).returns(T.nilable(::String)) }
1184
+ def block_param(block); end
1185
+
1186
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#81
1187
+ sig { params(call: ::Mocktail::Call).returns(T.nilable(::String)) }
1188
+ def corrections(call); end
1189
+
1190
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#70
1191
+ sig { params(identifiers: T::Array[::String]).returns(T::Array[::String]) }
1192
+ def count_repeats(identifiers); end
1193
+
1194
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#56
1195
+ sig { params(kwargs: T::Hash[::Symbol, T.anything]).returns(T.nilable(::String)) }
1196
+ def kwparams_list(kwargs); end
1197
+
1198
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#36
1199
+ sig { params(call: ::Mocktail::Call).returns(T.nilable(::String)) }
1200
+ def params(call); end
1201
+
1202
+ # source://mocktail//lib/mocktail/sorbet/mocktail/raises_neato_no_method_error.rb#47
1203
+ sig { params(args: T::Array[T.anything]).returns(T.nilable(::String)) }
1204
+ def params_list(args); end
1205
+ end
1206
+
1207
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error.rb#8
1208
+ class Mocktail::RaisesVerificationError
1209
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error.rb#12
1210
+ sig { void }
1211
+ def initialize; end
1212
+
1213
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error.rb#19
1214
+ sig do
1215
+ params(
1216
+ recording: ::Mocktail::Call,
1217
+ verifiable_calls: T::Array[::Mocktail::Call],
1218
+ demo_config: ::Mocktail::DemoConfig
1219
+ ).void
1220
+ end
1221
+ def raise(recording, verifiable_calls, demo_config); end
1222
+
1223
+ private
1224
+
1225
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error.rb#50
1226
+ sig do
1227
+ params(
1228
+ recording: ::Mocktail::Call,
1229
+ verifiable_calls: T::Array[::Mocktail::Call],
1230
+ demo_config: ::Mocktail::DemoConfig
1231
+ ).returns(T.nilable(::String))
1232
+ end
1233
+ def describe_other_calls(recording, verifiable_calls, demo_config); end
1234
+
1235
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error.rb#39
1236
+ sig { params(demo_config: ::Mocktail::DemoConfig, count: ::Integer).returns(T.nilable(::String)) }
1237
+ def describe_verifiable_times_called(demo_config, count); end
1238
+
1239
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call/raises_verification_error.rb#66
1240
+ sig { params(s: ::String, count: T.nilable(::Integer)).returns(::String) }
1241
+ def pl(s, count); end
1242
+ end
1243
+
1244
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/reconciles_args_with_params.rb#4
1245
+ class Mocktail::ReconcilesArgsWithParams
1246
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/reconciles_args_with_params.rb#8
1247
+ sig { params(signature: ::Mocktail::Signature).returns(T::Boolean) }
1248
+ def reconcile(signature); end
1249
+
1250
+ private
1251
+
1252
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/reconciles_args_with_params.rb#16
1253
+ sig { params(arg_params: ::Mocktail::Params, args: T::Array[T.untyped]).returns(T::Boolean) }
1254
+ def args_match?(arg_params, args); end
1255
+
1256
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/reconciles_args_with_params.rb#22
1257
+ sig { params(kwarg_params: ::Mocktail::Params, kwargs: T::Hash[::Symbol, T.untyped]).returns(T::Boolean) }
1258
+ def kwargs_match?(kwarg_params, kwargs); end
1259
+ end
1260
+
1261
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb#4
1262
+ class Mocktail::ReconstructsCall
1263
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb#19
1264
+ sig do
1265
+ params(
1266
+ double: ::Object,
1267
+ call_binding: ::Binding,
1268
+ default_args: T.nilable(T::Hash[::Symbol, T.anything]),
1269
+ dry_class: T::Class[::Object],
1270
+ type: T.any(::Module, T::Class[T.anything]),
1271
+ method: ::Symbol,
1272
+ original_method: T.any(::Method, ::UnboundMethod),
1273
+ signature: ::Mocktail::Signature
1274
+ ).returns(::Mocktail::Call)
1275
+ end
1276
+ def reconstruct(double:, call_binding:, default_args:, dry_class:, type:, method:, original_method:, signature:); end
1277
+
1278
+ private
1279
+
1280
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb#39
1281
+ sig do
1282
+ params(
1283
+ signature: ::Mocktail::Signature,
1284
+ call_binding: ::Binding,
1285
+ default_args: T.nilable(T::Hash[::Symbol, T.anything])
1286
+ ).returns(T::Array[T.anything])
1287
+ end
1288
+ def args_for(signature, call_binding, default_args); end
1289
+
1290
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb#52
1291
+ sig do
1292
+ params(
1293
+ signature: ::Mocktail::Signature,
1294
+ call_binding: ::Binding,
1295
+ default_args: T.nilable(T::Hash[::Symbol, T.anything])
1296
+ ).returns(T::Hash[::Symbol, T.anything])
1297
+ end
1298
+ def kwargs_for(signature, call_binding, default_args); end
1299
+
1300
+ # source://mocktail//lib/mocktail/sorbet/mocktail/imitates_type/makes_double/declares_dry_class/reconstructs_call.rb#62
1301
+ sig do
1302
+ params(
1303
+ params: ::Mocktail::Params,
1304
+ default_args: T.nilable(T::Hash[::Symbol, T.anything])
1305
+ ).returns([T::Array[::Symbol], T.nilable(::Symbol)])
1306
+ end
1307
+ def non_default_args(params, default_args); end
1308
+ end
1309
+
1310
+ # source://mocktail//lib/mocktail/sorbet/mocktail/records_demonstration.rb#4
1311
+ class Mocktail::RecordsDemonstration
1312
+ # source://mocktail//lib/mocktail/sorbet/mocktail/records_demonstration.rb#14
1313
+ sig do
1314
+ type_parameters(:T)
1315
+ .params(
1316
+ demonstration: T.proc.params(matchers: ::Mocktail::MatcherPresentation).returns(T.type_parameter(:T)),
1317
+ demo_config: ::Mocktail::DemoConfig
1318
+ ).returns(::Mocktail::Call)
1319
+ end
1320
+ def record(demonstration, demo_config); end
1321
+ end
1322
+
1323
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/recreates_message.rb#4
1324
+ class Mocktail::RecreatesMessage
1325
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/recreates_message.rb#8
1326
+ sig { params(signature: ::Mocktail::Signature).returns(::String) }
1327
+ def recreate(signature); end
1328
+ end
1329
+
1330
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/redefines_new.rb#4
1331
+ class Mocktail::RedefinesNew
1332
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/redefines_new.rb#8
1333
+ sig { void }
1334
+ def initialize; end
1335
+
1336
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/redefines_new.rb#13
1337
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
1338
+ def redefine(type); end
1339
+ end
1340
+
1341
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/redefines_singleton_methods.rb#4
1342
+ class Mocktail::RedefinesSingletonMethods
1343
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/redefines_singleton_methods.rb#8
1344
+ sig { void }
1345
+ def initialize; end
1346
+
1347
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/redefines_singleton_methods.rb#47
1348
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
1349
+ def declare_singleton_method_missing_errors!(type); end
1350
+
1351
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/redefines_singleton_methods.rb#13
1352
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
1353
+ def redefine(type); end
1354
+
1355
+ private
1356
+
1357
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/redefines_singleton_methods.rb#72
1358
+ sig { params(method: ::Method).returns(T::Boolean) }
1359
+ def sorbet_method_hook?(method); end
1360
+ end
1361
+
1362
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_matcher.rb#4
1363
+ class Mocktail::RegistersMatcher
1364
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_matcher.rb#8
1365
+ sig { void }
1366
+ def initialize; end
1367
+
1368
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_matcher.rb#13
1369
+ sig { params(matcher_type: T.class_of(Mocktail::Matchers::Base)).void }
1370
+ def register(matcher_type); end
1371
+
1372
+ private
1373
+
1374
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_matcher.rb#59
1375
+ sig { params(matcher_type: T.class_of(Mocktail::Matchers::Base)).returns(T::Boolean) }
1376
+ def invalid_flag?(matcher_type); end
1377
+
1378
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_matcher.rb#51
1379
+ sig { params(matcher_type: T.class_of(Mocktail::Matchers::Base)).returns(T::Boolean) }
1380
+ def invalid_match?(matcher_type); end
1381
+
1382
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_matcher.rb#43
1383
+ sig { params(matcher_type: T.class_of(Mocktail::Matchers::Base)).returns(T::Boolean) }
1384
+ def invalid_name?(matcher_type); end
1385
+
1386
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_matcher.rb#38
1387
+ sig { params(matcher_type: T.class_of(Mocktail::Matchers::Base)).returns(T::Boolean) }
1388
+ def invalid_type?(matcher_type); end
1389
+ end
1390
+
1391
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_stubbing.rb#6
1392
+ class Mocktail::RegistersStubbing
1393
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_stubbing.rb#10
1394
+ sig { void }
1395
+ def initialize; end
1396
+
1397
+ # source://mocktail//lib/mocktail/sorbet/mocktail/registers_stubbing.rb#21
1398
+ sig do
1399
+ type_parameters(:T)
1400
+ .params(
1401
+ demonstration: T.proc.params(matchers: ::Mocktail::MatcherPresentation).returns(T.type_parameter(:T)),
1402
+ demo_config: ::Mocktail::DemoConfig
1403
+ ).returns(Mocktail::Stubbing[T.type_parameter(:T)])
1404
+ end
1405
+ def register(demonstration, demo_config); end
1406
+ end
1407
+
1408
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#47
1409
+ class Mocktail::ReplacedTypeExplanation < ::Mocktail::Explanation
1410
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#52
1411
+ sig { params(reference: ::Mocktail::TypeReplacementData, message: ::String).void }
1412
+ def initialize(reference, message); end
1413
+
1414
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/explanation.rb#49
1415
+ sig { override.returns(::Mocktail::TypeReplacementData) }
1416
+ def reference; end
1417
+ end
1418
+
1419
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_next.rb#4
1420
+ class Mocktail::ReplacesNext
1421
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_next.rb#8
1422
+ sig { void }
1423
+ def initialize; end
1424
+
1425
+ # @raise [UnsupportedMocktail]
1426
+ #
1427
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_next.rb#28
1428
+ sig do
1429
+ type_parameters(:T)
1430
+ .params(
1431
+ type: T::Class[T.all(::Object, T.type_parameter(:T))],
1432
+ count: ::Integer
1433
+ ).returns(T::Array[T.type_parameter(:T)])
1434
+ end
1435
+ def replace(type, count); end
1436
+
1437
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_next.rb#19
1438
+ sig do
1439
+ type_parameters(:T)
1440
+ .params(
1441
+ type: T::Class[T.all(::Object, T.type_parameter(:T))]
1442
+ ).returns(T.type_parameter(:T))
1443
+ end
1444
+ def replace_once(type); end
1445
+ end
1446
+
1447
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type.rb#8
1448
+ class Mocktail::ReplacesType
1449
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type.rb#12
1450
+ sig { void }
1451
+ def initialize; end
1452
+
1453
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type.rb#20
1454
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
1455
+ def replace(type); end
1456
+ end
1457
+
1458
+ # source://mocktail//lib/mocktail/sorbet/mocktail/resets_state.rb#4
1459
+ class Mocktail::ResetsState
1460
+ # source://mocktail//lib/mocktail/sorbet/mocktail/resets_state.rb#8
1461
+ sig { void }
1462
+ def reset; end
1463
+ end
1464
+
1465
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/runs_sorbet_sig_blocks_before_replacement.rb#4
1466
+ class Mocktail::RunsSorbetSigBlocksBeforeReplacement
1467
+ # This is necessary because when Sorbet runs a sig block of a singleton
1468
+ # method, it has the net effect of unwrapping/redefining the method. If
1469
+ # we try to use Mocktail.replace(Foo) and Foo.bar has a Sorbet sig block,
1470
+ # then we'll end up with three "versions" of the same method and no way
1471
+ # to keep straight which one == which:
1472
+ #
1473
+ # A - Foo.bar, as defined in the original class
1474
+ # B - Foo.bar, as redefined by RedefinesSingletonMethods
1475
+ # C - Foo.bar, as wrapped by sorbet-runtime
1476
+ #
1477
+ # Initially, Foo.method(:bar) would == C, but after the type
1478
+ # replacement, it would == B (with a reference back to C as the original),
1479
+ # but after handling a single dry call, our invocation of
1480
+ # GrabsOriginalMethodParameters.grab(Foo.method(:bar)) would invoke the
1481
+ # Sorbet `sig` block, which has the net effect of redefining the method back
1482
+ # to A.
1483
+ #
1484
+ # It's very fun and confusing and a great time.
1485
+ #
1486
+ # source://mocktail//lib/mocktail/sorbet/mocktail/replaces_type/runs_sorbet_sig_blocks_before_replacement.rb#26
1487
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
1488
+ def run(type); end
1489
+ end
1490
+
1491
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/signature.rb#23
1492
+ class Mocktail::Signature < ::T::Struct
1493
+ const :positional_params, ::Mocktail::Params
1494
+ const :positional_args, T::Array[T.anything]
1495
+ const :keyword_params, ::Mocktail::Params
1496
+ const :keyword_args, T::Hash[::Symbol, T.anything]
1497
+ const :block_param, T.nilable(::Symbol)
1498
+ const :block_arg, T.nilable(::Proc), default: T.unsafe(nil)
1499
+
1500
+ class << self
1501
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
1502
+ def inherited(s); end
1503
+ end
1504
+ end
1505
+
1506
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/signature.rb#33
1507
+ Mocktail::Signature::DEFAULT_BLOCK_PARAM = T.let(T.unsafe(nil), String)
1508
+
1509
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/signature.rb#31
1510
+ Mocktail::Signature::DEFAULT_REST_ARGS = T.let(T.unsafe(nil), String)
1511
+
1512
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/signature.rb#32
1513
+ Mocktail::Signature::DEFAULT_REST_KWARGS = T.let(T.unsafe(nil), String)
1514
+
1515
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error.rb#10
1516
+ class Mocktail::SimulatesArgumentError
1517
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error.rb#14
1518
+ sig { void }
1519
+ def initialize; end
1520
+
1521
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error.rb#23
1522
+ sig { params(dry_call: ::Mocktail::Call).returns(T.nilable(::ArgumentError)) }
1523
+ def simulate(dry_call); end
1524
+ end
1525
+
1526
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#4
1527
+ class Mocktail::StringifiesCall
1528
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#8
1529
+ sig { params(call: ::Mocktail::Call, anonymous_blocks: T::Boolean, always_parens: T::Boolean).returns(::String) }
1530
+ def stringify(call, anonymous_blocks: T.unsafe(nil), always_parens: T.unsafe(nil)); end
1531
+
1532
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#13
1533
+ sig do
1534
+ params(
1535
+ calls: T::Array[::Mocktail::Call],
1536
+ nonzero_message: ::String,
1537
+ zero_message: ::String,
1538
+ anonymous_blocks: T::Boolean,
1539
+ always_parens: T::Boolean
1540
+ ).returns(::String)
1541
+ end
1542
+ def stringify_multiple(calls, nonzero_message:, zero_message:, anonymous_blocks: T.unsafe(nil), always_parens: T.unsafe(nil)); end
1543
+
1544
+ private
1545
+
1546
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#47
1547
+ sig { params(args: T::Array[::Object]).returns(T.nilable(::String)) }
1548
+ def argify(args); end
1549
+
1550
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#30
1551
+ sig { params(call: ::Mocktail::Call, parens: T::Boolean).returns(T.nilable(::String)) }
1552
+ def args_to_s(call, parens: T.unsafe(nil)); end
1553
+
1554
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#65
1555
+ sig { params(block: T.nilable(::Proc), anonymous: T::Boolean).returns(T.nilable(::String)) }
1556
+ def blockify(block, anonymous:); end
1557
+
1558
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#53
1559
+ sig { params(kwargs: T::Hash[::Symbol, ::Object]).returns(T.nilable(::String)) }
1560
+ def kwargify(kwargs); end
1561
+
1562
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#59
1563
+ sig { params(block: T.nilable(::Proc)).returns(T.nilable(::String)) }
1564
+ def lambdafy(block); end
1565
+
1566
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#76
1567
+ sig { params(block: ::Proc).returns(::String) }
1568
+ def source_locationify(block); end
1569
+
1570
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_call.rb#81
1571
+ sig { params(path: ::String).returns(::String) }
1572
+ def strip_pwd(path); end
1573
+ end
1574
+
1575
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_method_name.rb#4
1576
+ class Mocktail::StringifiesMethodName
1577
+ # source://mocktail//lib/mocktail/sorbet/mocktail/share/stringifies_method_name.rb#8
1578
+ sig { params(call: ::Mocktail::Call).returns(::String) }
1579
+ def stringify(call); end
1580
+ end
1581
+
1582
+ # source://mocktail//lib/mocktail/sorbet/mocktail/stringifies_method_signature.rb#4
1583
+ class Mocktail::StringifiesMethodSignature
1584
+ # source://mocktail//lib/mocktail/sorbet/mocktail/stringifies_method_signature.rb#8
1585
+ sig { params(signature: ::Mocktail::Signature).returns(::String) }
1586
+ def stringify(signature); end
1587
+
1588
+ private
1589
+
1590
+ # source://mocktail//lib/mocktail/sorbet/mocktail/stringifies_method_signature.rb#45
1591
+ sig { params(signature: ::Mocktail::Signature).returns(::String) }
1592
+ def block(signature); end
1593
+
1594
+ # source://mocktail//lib/mocktail/sorbet/mocktail/stringifies_method_signature.rb#32
1595
+ sig { params(signature: ::Mocktail::Signature).returns(T.nilable(::String)) }
1596
+ def keyword(signature); end
1597
+
1598
+ # source://mocktail//lib/mocktail/sorbet/mocktail/stringifies_method_signature.rb#19
1599
+ sig { params(signature: ::Mocktail::Signature).returns(T.nilable(::String)) }
1600
+ def positional(signature); end
1601
+ end
1602
+
1603
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/stubbing.rb#4
1604
+ class Mocktail::Stubbing < ::T::Struct
1605
+ extend T::Generic
1606
+
1607
+ MethodReturnType = type_member
1608
+
1609
+ const :demonstration, T.proc.params(matchers: ::Mocktail::MatcherPresentation).returns(MethodReturnType)
1610
+ const :demo_config, ::Mocktail::DemoConfig
1611
+ prop :satisfaction_count, ::Integer, default: T.unsafe(nil)
1612
+ const :recording, ::Mocktail::Call
1613
+ prop :effect, T.nilable(T.proc.params(call: ::Mocktail::Call).returns(MethodReturnType))
1614
+
1615
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/stubbing.rb#16
1616
+ sig { void }
1617
+ def satisfied!; end
1618
+
1619
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/stubbing.rb#21
1620
+ sig { params(block: T.proc.params(call: ::Mocktail::Call).returns(MethodReturnType)).void }
1621
+ def with(&block); end
1622
+
1623
+ class << self
1624
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
1625
+ def inherited(s); end
1626
+ end
1627
+ end
1628
+
1629
+ # source://mocktail//lib/mocktail/sorbet/mocktail/typed.rb#4
1630
+ Mocktail::TYPED = T.let(T.unsafe(nil), TrueClass)
1631
+
1632
+ # The TopShelf is where we keep all the more global, dangerous state.
1633
+ # In particular, this is where Mocktail manages state related to singleton
1634
+ # method replacements carried out with Mocktail.replace(ClassOrModule)
1635
+ #
1636
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#7
1637
+ # The TopShelf is where we keep all the more global, dangerous state.
1638
+ # In particular, this is where Mocktail manages state related to singleton
1639
+ class Mocktail::TopShelf
1640
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#19
1641
+ sig { void }
1642
+ def initialize; end
1643
+
1644
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#50
1645
+ sig { params(type: T.any(::Module, T::Class[T.anything])).returns(T::Boolean) }
1646
+ def new_replaced?(type); end
1647
+
1648
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#60
1649
+ sig { params(type: T::Class[T.anything]).returns(T::Boolean) }
1650
+ def of_next_registered?(type); end
1651
+
1652
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#45
1653
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
1654
+ def register_new_replacement!(type); end
1655
+
1656
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#55
1657
+ sig { params(type: T::Class[T.anything]).void }
1658
+ def register_of_next_replacement!(type); end
1659
+
1660
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#70
1661
+ sig { params(type: T.any(::Module, T::Class[T.anything])).void }
1662
+ def register_singleton_method_replacement!(type); end
1663
+
1664
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#40
1665
+ sig { void }
1666
+ def reset_current_thread!; end
1667
+
1668
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#75
1669
+ sig { params(type: T.any(::Module, T::Class[T.anything])).returns(T::Boolean) }
1670
+ def singleton_methods_replaced?(type); end
1671
+
1672
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#26
1673
+ sig { params(type: T.any(::Module, T::Class[T.anything])).returns(::Mocktail::TypeReplacement) }
1674
+ def type_replacement_for(type); end
1675
+
1676
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#33
1677
+ sig { params(type: T.any(::Module, T::Class[T.anything])).returns(T.nilable(::Mocktail::TypeReplacement)) }
1678
+ def type_replacement_if_exists_for(type); end
1679
+
1680
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#65
1681
+ sig { params(type: T::Class[T.anything]).void }
1682
+ def unregister_of_next_replacement!(type); end
1683
+
1684
+ class << self
1685
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/top_shelf.rb#11
1686
+ sig { returns(::Mocktail::TopShelf) }
1687
+ def instance; end
1688
+ end
1689
+ end
1690
+
1691
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/transforms_params.rb#6
1692
+ class Mocktail::TransformsParams
1693
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/transforms_params.rb#10
1694
+ sig { void }
1695
+ def initialize; end
1696
+
1697
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/transforms_params.rb#15
1698
+ sig do
1699
+ params(
1700
+ dry_call: ::Mocktail::Call,
1701
+ params: T.nilable(T::Array[T::Array[::Symbol]])
1702
+ ).returns(::Mocktail::Signature)
1703
+ end
1704
+ def transform(dry_call, params: T.unsafe(nil)); end
1705
+
1706
+ private
1707
+
1708
+ # source://mocktail//lib/mocktail/sorbet/mocktail/simulates_argument_error/transforms_params.rb#48
1709
+ sig { params(params: T::Array[T::Array[::Symbol]]).returns(T::Array[T::Array[::Symbol]]) }
1710
+ def name_unnamed_params(params); end
1711
+ end
1712
+
1713
+ # source://mocktail//lib/mocktail/sorbet/mocktail/errors.rb#18
1714
+ class Mocktail::TypeCheckingError < ::Mocktail::Error; end
1715
+
1716
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/type_replacement.rb#4
1717
+ class Mocktail::TypeReplacement < ::T::Struct
1718
+ const :type, T.any(::Module, T::Class[T.anything])
1719
+ prop :original_methods, T.nilable(T::Array[::Method])
1720
+ prop :replacement_methods, T.nilable(T::Array[::Method])
1721
+ prop :original_new, T.nilable(::Method)
1722
+ prop :replacement_new, T.nilable(::Method)
1723
+
1724
+ class << self
1725
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
1726
+ def inherited(s); end
1727
+ end
1728
+ end
1729
+
1730
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/type_replacement_data.rb#4
1731
+ class Mocktail::TypeReplacementData < ::T::Struct
1732
+ include ::Mocktail::ExplanationData
1733
+
1734
+ const :type, T.any(::Module, T::Class[T.anything])
1735
+ const :replaced_method_names, T::Array[::Symbol]
1736
+ const :calls, T::Array[::Mocktail::Call]
1737
+ const :stubbings, T::Array[Mocktail::Stubbing[T.anything]]
1738
+
1739
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/type_replacement_data.rb#15
1740
+ sig { returns(T.any(::Module, T::Class[T.anything])) }
1741
+ def double; end
1742
+
1743
+ class << self
1744
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
1745
+ def inherited(s); end
1746
+ end
1747
+ end
1748
+
1749
+ # source://mocktail//lib/mocktail/sorbet/mocktail/errors.rb#6
1750
+ class Mocktail::UnexpectedError < ::Mocktail::Error; end
1751
+
1752
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/unsatisfying_call.rb#4
1753
+ class Mocktail::UnsatisfyingCall < ::T::Struct
1754
+ const :call, ::Mocktail::Call
1755
+ const :other_stubbings, T::Array[Mocktail::Stubbing[T.anything]]
1756
+ const :backtrace, T::Array[::String]
1757
+
1758
+ class << self
1759
+ # source://sorbet-runtime/0.5.10983/lib/types/struct.rb#13
1760
+ def inherited(s); end
1761
+ end
1762
+ end
1763
+
1764
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/unsatisfying_call_explanation.rb#4
1765
+ class Mocktail::UnsatisfyingCallExplanation
1766
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/unsatisfying_call_explanation.rb#14
1767
+ sig { params(reference: ::Mocktail::UnsatisfyingCall, message: ::String).void }
1768
+ def initialize(reference, message); end
1769
+
1770
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/unsatisfying_call_explanation.rb#11
1771
+ sig { returns(::String) }
1772
+ def message; end
1773
+
1774
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/unsatisfying_call_explanation.rb#8
1775
+ sig { returns(::Mocktail::UnsatisfyingCall) }
1776
+ def reference; end
1777
+
1778
+ # source://mocktail//lib/mocktail/sorbet/mocktail/value/unsatisfying_call_explanation.rb#20
1779
+ sig { returns(T.class_of(Mocktail::UnsatisfyingCallExplanation)) }
1780
+ def type; end
1781
+ end
1782
+
1783
+ # source://mocktail//lib/mocktail/sorbet/mocktail/errors.rb#8
1784
+ class Mocktail::UnsupportedMocktail < ::Mocktail::Error; end
1785
+
1786
+ # source://mocktail//lib/mocktail/sorbet/mocktail/version.rb#11
1787
+ Mocktail::VERSION = T.let(T.unsafe(nil), String)
1788
+
1789
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/validates_arguments.rb#4
1790
+ class Mocktail::ValidatesArguments
1791
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/validates_arguments.rb#32
1792
+ sig { void }
1793
+ def initialize; end
1794
+
1795
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/validates_arguments.rb#37
1796
+ sig { params(dry_call: ::Mocktail::Call).returns(::NilClass) }
1797
+ def validate(dry_call); end
1798
+
1799
+ class << self
1800
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/validates_arguments.rb#7
1801
+ sig { void }
1802
+ def disable!; end
1803
+
1804
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/validates_arguments.rb#17
1805
+ sig { returns(T::Boolean) }
1806
+ def disabled?; end
1807
+
1808
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/validates_arguments.rb#12
1809
+ sig { void }
1810
+ def enable!; end
1811
+
1812
+ # source://mocktail//lib/mocktail/sorbet/mocktail/handles_dry_call/validates_arguments.rb#22
1813
+ sig { params(disable: T.nilable(T::Boolean), blk: T.proc.returns(T.anything)).void }
1814
+ def optional(disable, &blk); end
1815
+ end
1816
+ end
1817
+
1818
+ # source://mocktail//lib/mocktail/sorbet/mocktail/errors.rb#16
1819
+ class Mocktail::VerificationError < ::Mocktail::Error; end
1820
+
1821
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call.rb#8
1822
+ class Mocktail::VerifiesCall
1823
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call.rb#12
1824
+ sig { void }
1825
+ def initialize; end
1826
+
1827
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call.rb#19
1828
+ sig do
1829
+ params(
1830
+ demo: T.proc.params(matchers: ::Mocktail::MatcherPresentation).void,
1831
+ demo_config: ::Mocktail::DemoConfig
1832
+ ).void
1833
+ end
1834
+ def verify(demo, demo_config); end
1835
+
1836
+ private
1837
+
1838
+ # source://mocktail//lib/mocktail/sorbet/mocktail/verifies_call.rb#32
1839
+ sig { params(verifiable_call_count: ::Integer, demo_config: ::Mocktail::DemoConfig).returns(T::Boolean) }
1840
+ def verification_satisfied?(verifiable_call_count, demo_config); end
1841
+ end
1842
+
1843
+ # sorbet gem fails to export some of these constants, so we need to in order to
1844
+ # pass static typecheck
1845
+ module T
1846
+ module Private
1847
+ module Methods
1848
+ module MethodHooks; end
1849
+
1850
+ class Signature
1851
+ sig { returns(T::Array[T::Array[Symbol]]) }
1852
+ def parameters; end
1853
+ end
1854
+
1855
+ module SingletonMethodHooks; end
1856
+ end
1857
+
1858
+ module RuntimeLevels
1859
+ class << self
1860
+ sig { returns(Symbol) }
1861
+ def default_checked_level; end
1862
+ end
1863
+ end
1864
+ end
1865
+ end