packwerk 3.2.2 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/packwerk/application_validator.rb +2 -1
- data/lib/packwerk/graph.rb +15 -56
- data/lib/packwerk/reference_checking/checkers/dependency_checker.rb +1 -2
- data/lib/packwerk/run_context.rb +5 -0
- data/lib/packwerk/validators/dependency_validator.rb +5 -4
- data/lib/packwerk/version.rb +1 -1
- data/sorbet/rbi/gems/{actionpack@7.0.3.1.rbi → actionpack@7.0.8.7.rbi} +1338 -1227
- data/sorbet/rbi/gems/{actionview@7.0.3.1.rbi → actionview@7.0.8.7.rbi} +548 -503
- data/sorbet/rbi/gems/{activesupport@7.0.3.1.rbi → activesupport@7.0.8.7.rbi} +714 -635
- data/sorbet/rbi/gems/{better_html@2.0.1.rbi → better_html@2.1.1.rbi} +21 -21
- data/sorbet/rbi/gems/{concurrent-ruby@1.1.10.rbi → concurrent-ruby@1.3.5.rbi} +1390 -1366
- data/sorbet/rbi/gems/{constant_resolver@0.2.0.rbi → constant_resolver@0.3.0.rbi} +22 -13
- data/sorbet/rbi/gems/{erubi@1.11.0.rbi → erubi@1.13.1.rbi} +28 -17
- data/sorbet/rbi/gems/{i18n@1.12.0.rbi → i18n@1.14.7.rbi} +234 -172
- data/sorbet/rbi/gems/{json@2.6.2.rbi → json@2.7.2.rbi} +94 -74
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
- data/sorbet/rbi/gems/{loofah@2.18.0.rbi → loofah@2.24.0.rbi} +470 -243
- data/sorbet/rbi/gems/{minitest@5.16.2.rbi → minitest@5.25.4.rbi} +577 -472
- data/sorbet/rbi/gems/{mocha@1.14.0.rbi → mocha@2.5.0.rbi} +468 -684
- data/sorbet/rbi/gems/{nokogiri@1.15.3.rbi → nokogiri@1.18.4.rbi} +1756 -869
- data/sorbet/rbi/gems/{parallel@1.24.0.rbi → parallel@1.25.1.rbi} +26 -20
- data/sorbet/rbi/gems/{racc@1.7.1.rbi → racc@1.8.1.rbi} +36 -36
- data/sorbet/rbi/gems/{rack-test@2.0.2.rbi → rack-test@2.2.0.rbi} +87 -114
- data/sorbet/rbi/gems/{rack@2.2.4.rbi → rack@2.2.13.rbi} +243 -195
- data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +754 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +764 -0
- data/sorbet/rbi/gems/{railties@7.0.3.1.rbi → railties@7.0.8.7.rbi} +146 -140
- data/sorbet/rbi/gems/{regexp_parser@2.5.0.rbi → regexp_parser@2.9.2.rbi} +947 -542
- data/sorbet/rbi/gems/{rexml@3.2.5.rbi → rexml@3.3.9.rbi} +452 -312
- data/sorbet/rbi/gems/{rubocop-ast@1.21.0.rbi → rubocop-ast@1.31.3.rbi} +717 -588
- data/sorbet/rbi/gems/{rubocop@1.34.1.rbi → rubocop@1.64.1.rbi} +10916 -4406
- data/sorbet/rbi/gems/{ruby-progressbar@1.11.0.rbi → ruby-progressbar@1.13.0.rbi} +359 -281
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
- data/sorbet/rbi/gems/{tzinfo@2.0.5.rbi → tzinfo@2.0.6.rbi} +144 -141
- data/sorbet/rbi/gems/{unicode-display_width@2.2.0.rbi → unicode-display_width@2.5.0.rbi} +24 -7
- metadata +36 -41
- data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +0 -8
- data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +0 -8
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +0 -455
- data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +0 -542
- data/sorbet/rbi/gems/ruby-lsp@0.2.3.rbi +0 -11
- data/sorbet/rbi/gems/syntax_tree@3.3.0.rbi +0 -8
- /data/sorbet/rbi/gems/{builder@3.2.4.rbi → builder@3.3.0.rbi} +0 -0
- /data/sorbet/rbi/gems/{parser@3.3.1.0.rbi → parser@3.3.3.0.rbi} +0 -0
@@ -4,7 +4,7 @@
|
|
4
4
|
# This is an autogenerated file for types exported from the `mocha` gem.
|
5
5
|
# Please instead update this file by running `bin/tapioca gem mocha`.
|
6
6
|
|
7
|
-
# source://mocha//lib/mocha/inspect.rb#
|
7
|
+
# source://mocha//lib/mocha/inspect.rb#56
|
8
8
|
class Array
|
9
9
|
include ::Enumerable
|
10
10
|
include ::Mocha::Inspect::ArrayMethods
|
@@ -14,13 +14,13 @@ class Class < ::Module
|
|
14
14
|
include ::Mocha::ClassMethods
|
15
15
|
end
|
16
16
|
|
17
|
-
# source://mocha//lib/mocha/inspect.rb#
|
17
|
+
# source://mocha//lib/mocha/inspect.rb#68
|
18
18
|
class Date
|
19
19
|
include ::Comparable
|
20
20
|
include ::Mocha::Inspect::DateMethods
|
21
21
|
end
|
22
22
|
|
23
|
-
# source://mocha//lib/mocha/inspect.rb#
|
23
|
+
# source://mocha//lib/mocha/inspect.rb#60
|
24
24
|
class Hash
|
25
25
|
include ::Enumerable
|
26
26
|
include ::Mocha::Inspect::HashMethods
|
@@ -30,7 +30,7 @@ class Minitest::Test < ::Minitest::Runnable
|
|
30
30
|
include ::Mocha::ParameterMatchers
|
31
31
|
include ::Mocha::Hooks
|
32
32
|
include ::Mocha::API
|
33
|
-
include ::Mocha::Integration::
|
33
|
+
include ::Mocha::Integration::Minitest::Adapter
|
34
34
|
end
|
35
35
|
|
36
36
|
# source://mocha//lib/mocha/version.rb#1
|
@@ -38,7 +38,7 @@ module Mocha
|
|
38
38
|
class << self
|
39
39
|
# @private
|
40
40
|
#
|
41
|
-
# source://mocha//lib/mocha/configuration.rb#
|
41
|
+
# source://mocha//lib/mocha/configuration.rb#24
|
42
42
|
def configuration; end
|
43
43
|
|
44
44
|
# Allows setting of configuration options. See {Configuration} for the available options.
|
@@ -54,12 +54,12 @@ module Mocha
|
|
54
54
|
# @see Configuration
|
55
55
|
# @yieldparam configuration [Configuration] the configuration for modification
|
56
56
|
#
|
57
|
-
# source://mocha//lib/mocha/configuration.rb#
|
57
|
+
# source://mocha//lib/mocha/configuration.rb#19
|
58
58
|
def configure; end
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
# Methods added to +Test::Unit::TestCase+, +
|
62
|
+
# Methods added to +Test::Unit::TestCase+, +Minitest::Unit::TestCase+ or equivalent.
|
63
63
|
# The mock creation methods are {#mock}, {#stub} and {#stub_everything}, all of which return a #{Mock}
|
64
64
|
# which can be further modified by {Mock#responds_like} and {Mock#responds_like_instance_of} methods,
|
65
65
|
# both of which return a {Mock}, too, and can therefore, be chained to the original creation methods.
|
@@ -84,7 +84,7 @@ end
|
|
84
84
|
# sheep.chew
|
85
85
|
# sheep.foo # => raises NoMethodError exception
|
86
86
|
#
|
87
|
-
# source://mocha//lib/mocha/api.rb#
|
87
|
+
# source://mocha//lib/mocha/api.rb#34
|
88
88
|
module Mocha::API
|
89
89
|
include ::Mocha::ParameterMatchers
|
90
90
|
include ::Mocha::Hooks
|
@@ -93,7 +93,7 @@ module Mocha::API
|
|
93
93
|
#
|
94
94
|
# @example Using expected_methods_vs_return_values Hash to setup expectations.
|
95
95
|
# def test_motor_starts_and_stops
|
96
|
-
# motor = mock('motor', :
|
96
|
+
# motor = mock('motor', start: true, stop: true)
|
97
97
|
# assert motor.start
|
98
98
|
# assert motor.stop
|
99
99
|
# # an error will be raised unless both Motor#start and Motor#stop have been called
|
@@ -108,20 +108,40 @@ module Mocha::API
|
|
108
108
|
|
109
109
|
# Builds a new sequence which can be used to constrain the order in which expectations can occur.
|
110
110
|
#
|
111
|
-
# Specify that an expected invocation must occur within a named {Sequence} by
|
111
|
+
# Specify that an expected invocation must occur within a named {Sequence} by calling {Expectation#in_sequence}
|
112
|
+
# on each expectation or by passing a block within which all expectations should be constrained by the {Sequence}.
|
112
113
|
#
|
113
114
|
# @example Ensure methods on egg are invoked in correct order.
|
114
115
|
# breakfast = sequence('breakfast')
|
115
116
|
#
|
116
|
-
# egg = mock('egg')
|
117
|
-
# expects(:crack).in_sequence(breakfast)
|
118
|
-
# expects(:fry).in_sequence(breakfast)
|
119
|
-
# expects(:eat).in_sequence(breakfast)
|
117
|
+
# egg = mock('egg')
|
118
|
+
# egg.expects(:crack).in_sequence(breakfast)
|
119
|
+
# egg.expects(:fry).in_sequence(breakfast)
|
120
|
+
# egg.expects(:eat).in_sequence(breakfast)
|
121
|
+
# @example Ensure methods across multiple objects are invoked in correct order.
|
122
|
+
# sequence = sequence(:task_order)
|
123
|
+
#
|
124
|
+
# task_one = mock("task_one")
|
125
|
+
# task_two = mock("task_two")
|
126
|
+
#
|
127
|
+
# task_one.expects(:execute).in_sequence(sequence)
|
128
|
+
# task_two.expects(:execute).in_sequence(sequence)
|
129
|
+
#
|
130
|
+
# task_one.execute
|
131
|
+
# task_two.execute
|
132
|
+
# @example Ensure methods on egg are invoked in the correct order using a block.
|
133
|
+
# egg = mock('egg')
|
134
|
+
# sequence('breakfast') do
|
135
|
+
# egg.expects(:crack)
|
136
|
+
# egg.expects(:fry)
|
137
|
+
# egg.expects(:eat)
|
120
138
|
# end
|
139
|
+
# @param name [String] name of sequence
|
121
140
|
# @return [Sequence] a new sequence
|
122
141
|
# @see Expectation#in_sequence
|
142
|
+
# @yield optional block within which expectations should be constrained by the sequence
|
123
143
|
#
|
124
|
-
# source://mocha//lib/mocha/api.rb#
|
144
|
+
# source://mocha//lib/mocha/api.rb#170
|
125
145
|
def sequence(name); end
|
126
146
|
|
127
147
|
# Builds a new state machine which can be used to constrain the order in which expectations can occur.
|
@@ -137,28 +157,27 @@ module Mocha::API
|
|
137
157
|
# @example Constrain expected invocations to occur in particular states.
|
138
158
|
# power = states('power').starts_as('off')
|
139
159
|
#
|
140
|
-
# radio = mock('radio')
|
141
|
-
# expects(:switch_on).then(power.is('on'))
|
142
|
-
# expects(:select_channel).with('BBC Radio 4').when(power.is('on'))
|
143
|
-
# expects(:adjust_volume).with(+5).when(power.is('on'))
|
144
|
-
# expects(:select_channel).with('BBC World Service').when(power.is('on'))
|
145
|
-
# expects(:adjust_volume).with(-5).when(power.is('on'))
|
146
|
-
# expects(:switch_off).then(power.is('off'))
|
147
|
-
#
|
160
|
+
# radio = mock('radio')
|
161
|
+
# radio.expects(:switch_on).then(power.is('on'))
|
162
|
+
# radio.expects(:select_channel).with('BBC Radio 4').when(power.is('on'))
|
163
|
+
# radio.expects(:adjust_volume).with(+5).when(power.is('on'))
|
164
|
+
# radio.expects(:select_channel).with('BBC World Service').when(power.is('on'))
|
165
|
+
# radio.expects(:adjust_volume).with(-5).when(power.is('on'))
|
166
|
+
# radio.expects(:switch_off).then(power.is('off'))
|
167
|
+
# @param name [String] name of state machine
|
148
168
|
# @return [StateMachine] a new state machine
|
149
169
|
# @see Expectation#then
|
150
170
|
# @see Expectation#when
|
151
171
|
# @see StateMachine
|
152
172
|
#
|
153
|
-
# source://mocha//lib/mocha/api.rb#
|
173
|
+
# source://mocha//lib/mocha/api.rb#207
|
154
174
|
def states(name); end
|
155
175
|
|
156
176
|
# Builds a new mock object
|
157
177
|
#
|
158
|
-
#
|
159
178
|
# @example Using stubbed_methods_vs_return_values Hash to setup stubbed methods.
|
160
179
|
# def test_motor_starts_and_stops
|
161
|
-
# motor = stub('motor', :
|
180
|
+
# motor = stub('motor', start: true, stop: true)
|
162
181
|
# assert motor.start
|
163
182
|
# assert motor.stop
|
164
183
|
# # an error will not be raised even if either Motor#start or Motor#stop has not been called
|
@@ -168,15 +187,14 @@ module Mocha::API
|
|
168
187
|
# @overload stub
|
169
188
|
# @return [Mock] a new mock object
|
170
189
|
#
|
171
|
-
# source://mocha//lib/mocha/api.rb#
|
190
|
+
# source://mocha//lib/mocha/api.rb#96
|
172
191
|
def stub(*arguments); end
|
173
192
|
|
174
193
|
# Builds a mock object that accepts calls to any method. By default it will return +nil+ for any method call.
|
175
194
|
#
|
176
|
-
#
|
177
195
|
# @example Ignore invocations of irrelevant methods.
|
178
196
|
# def test_motor_stops
|
179
|
-
# motor = stub_everything('motor', :
|
197
|
+
# motor = stub_everything('motor', stop: true)
|
180
198
|
# assert_nil motor.irrelevant_method_1 # => no error raised
|
181
199
|
# assert_nil motor.irrelevant_method_2 # => no error raised
|
182
200
|
# assert motor.stop
|
@@ -186,38 +204,35 @@ module Mocha::API
|
|
186
204
|
# @overload stub_everything
|
187
205
|
# @return [Mock] a new mock object
|
188
206
|
#
|
189
|
-
# source://mocha//lib/mocha/api.rb#
|
207
|
+
# source://mocha//lib/mocha/api.rb#123
|
190
208
|
def stub_everything(*arguments); end
|
191
209
|
|
192
210
|
class << self
|
193
211
|
# @private
|
194
212
|
# @private
|
195
213
|
#
|
196
|
-
# source://mocha//lib/mocha/api.rb#
|
214
|
+
# source://mocha//lib/mocha/api.rb#45
|
197
215
|
def extended(mod); end
|
198
216
|
|
199
217
|
# @private
|
200
218
|
# @private
|
201
219
|
#
|
202
|
-
# source://mocha//lib/mocha/api.rb#
|
220
|
+
# source://mocha//lib/mocha/api.rb#39
|
203
221
|
def included(_mod); end
|
204
222
|
end
|
205
223
|
end
|
206
224
|
|
207
|
-
# source://mocha//lib/mocha/any_instance_method.rb#
|
225
|
+
# source://mocha//lib/mocha/any_instance_method.rb#4
|
208
226
|
class Mocha::AnyInstanceMethod < ::Mocha::StubbedMethod
|
209
227
|
private
|
210
228
|
|
211
|
-
# source://mocha//lib/mocha/any_instance_method.rb#
|
212
|
-
def method_body(method); end
|
213
|
-
|
214
|
-
# source://mocha//lib/mocha/any_instance_method.rb#8
|
229
|
+
# source://mocha//lib/mocha/any_instance_method.rb#7
|
215
230
|
def mock_owner; end
|
216
231
|
|
217
|
-
# source://mocha//lib/mocha/any_instance_method.rb#
|
232
|
+
# source://mocha//lib/mocha/any_instance_method.rb#15
|
218
233
|
def original_method_owner; end
|
219
234
|
|
220
|
-
# source://mocha//lib/mocha/any_instance_method.rb#
|
235
|
+
# source://mocha//lib/mocha/any_instance_method.rb#11
|
221
236
|
def stubbee_method(method_name); end
|
222
237
|
end
|
223
238
|
|
@@ -480,7 +495,7 @@ class Mocha::ClassMethods::AnyInstance
|
|
480
495
|
# @return [Boolean]
|
481
496
|
#
|
482
497
|
# source://mocha//lib/mocha/class_methods.rb#29
|
483
|
-
def respond_to?(
|
498
|
+
def respond_to?(symbol, include_all = T.unsafe(nil)); end
|
484
499
|
|
485
500
|
# source://mocha//lib/mocha/class_methods.rb#25
|
486
501
|
def stubba_class; end
|
@@ -505,12 +520,12 @@ end
|
|
505
520
|
# c.stubbing_method_on_nil = :allow
|
506
521
|
# end
|
507
522
|
#
|
508
|
-
# source://mocha//lib/mocha/configuration.rb#
|
523
|
+
# source://mocha//lib/mocha/configuration.rb#39
|
509
524
|
class Mocha::Configuration
|
510
525
|
# @private
|
511
526
|
# @return [Configuration] a new instance of Configuration
|
512
527
|
#
|
513
|
-
# source://mocha//lib/mocha/configuration.rb#
|
528
|
+
# source://mocha//lib/mocha/configuration.rb#55
|
514
529
|
def initialize(options = T.unsafe(nil)); end
|
515
530
|
|
516
531
|
# Display matching invocations alongside expectations on Mocha-related test failure.
|
@@ -538,75 +553,68 @@ class Mocha::Configuration
|
|
538
553
|
# - #<Mock:foo>.baz(5, 6) # => threw (:tag, "value")
|
539
554
|
# @param value [Boolean] +true+ to enable display of matching invocations; disabled by default.
|
540
555
|
#
|
541
|
-
# source://mocha//lib/mocha/configuration.rb#
|
556
|
+
# source://mocha//lib/mocha/configuration.rb#244
|
542
557
|
def display_matching_invocations_on_failure=(value); end
|
543
558
|
|
544
559
|
# @private
|
545
560
|
# @return [Boolean]
|
546
561
|
#
|
547
|
-
# source://mocha//lib/mocha/configuration.rb#
|
562
|
+
# source://mocha//lib/mocha/configuration.rb#249
|
548
563
|
def display_matching_invocations_on_failure?; end
|
549
564
|
|
550
565
|
# @private
|
551
566
|
#
|
552
|
-
# source://mocha//lib/mocha/configuration.rb#
|
567
|
+
# source://mocha//lib/mocha/configuration.rb#65
|
553
568
|
def merge(other); end
|
554
569
|
|
555
|
-
#
|
570
|
+
# Perform strict keyword argument comparison. Only supported in Ruby >= v2.7.
|
556
571
|
#
|
557
|
-
#
|
558
|
-
# Now these methods build a *named* mock with the name specified by the symbol argument; *no* methods are expected or stubbed and subsequent arguments *are* taken into account.
|
572
|
+
# When this option is set to +false+ a positional +Hash+ and a set of keyword arguments are treated the same during comparison, which can lead to misleading passing tests in Ruby >= v3.0 (see examples below). However, a deprecation warning will be displayed if a positional +Hash+ matches a set of keyword arguments or vice versa. This is because {#strict_keyword_argument_matching=} will default to +true+ in the future.
|
559
573
|
#
|
560
|
-
#
|
561
|
-
# Now a +LocalJumpError+ is raised.
|
574
|
+
# For more details on keyword arguments in Ruby v3, refer to {https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0 this article}.
|
562
575
|
#
|
563
|
-
#
|
576
|
+
# Note that +Hash+-related matchers such as {ParameterMatchers#has_value} or {ParameterMatchers#has_key} will still treat a positional +Hash+ and a set of keyword arguments the same, so misleading passing tests are still possible when they are used.
|
564
577
|
#
|
565
|
-
#
|
566
|
-
# Mocha.configure do |c|
|
567
|
-
# c.reinstate_undocumented_behaviour_from_v1_9 = true
|
568
|
-
# end
|
578
|
+
# This configuration option is +false+ by default to enable gradual adoption, but will be +true+ by default in the future.
|
569
579
|
#
|
570
|
-
#
|
571
|
-
# foo.inspect # => #<Mock>
|
580
|
+
# @example Loose keyword argument matching (default)
|
572
581
|
#
|
573
|
-
#
|
574
|
-
#
|
575
|
-
# - expected exactly once, invoked never: #<Mock>.foo
|
576
|
-
# @example Reinstate undocumented behaviour for {API#stub}
|
577
|
-
# Mocha.configure do |c|
|
578
|
-
# c.reinstate_undocumented_behaviour_from_v1_9 = true
|
582
|
+
# class Example
|
583
|
+
# def foo(a, bar:); end
|
579
584
|
# end
|
580
585
|
#
|
581
|
-
#
|
582
|
-
# foo.
|
583
|
-
# foo
|
584
|
-
#
|
585
|
-
#
|
586
|
-
# foo.stubs(:my_method).yields(1, 2)
|
587
|
-
# foo.my_method # => raises LocalJumpError when no block is supplied
|
586
|
+
# example = Example.new
|
587
|
+
# example.expects(:foo).with('a', bar: 'b')
|
588
|
+
# example.foo('a', { bar: 'b' })
|
589
|
+
# # This passes the test, but would result in an ArgumentError in practice
|
590
|
+
# @example Strict keyword argument matching
|
588
591
|
#
|
589
592
|
# Mocha.configure do |c|
|
590
|
-
# c.
|
593
|
+
# c.strict_keyword_argument_matching = true
|
591
594
|
# end
|
592
595
|
#
|
593
|
-
#
|
594
|
-
# foo
|
595
|
-
#
|
596
|
-
# @param value [Boolean] +true+ to reinstate undocumented behaviour; enabled by default.
|
596
|
+
# class Example
|
597
|
+
# def foo(a, bar:); end
|
598
|
+
# end
|
597
599
|
#
|
598
|
-
#
|
599
|
-
|
600
|
+
# example = Example.new
|
601
|
+
# example.expects(:foo).with('a', bar: 'b')
|
602
|
+
# example.foo('a', { bar: 'b' })
|
603
|
+
# # This now fails as expected
|
604
|
+
# @param value [Boolean] +true+ to enable strict keyword argument matching; +false+ by default.
|
605
|
+
#
|
606
|
+
# source://mocha//lib/mocha/configuration.rb#290
|
607
|
+
def strict_keyword_argument_matching=(value); end
|
600
608
|
|
601
609
|
# @private
|
602
610
|
# @return [Boolean]
|
603
611
|
#
|
604
|
-
# source://mocha//lib/mocha/configuration.rb#
|
605
|
-
def
|
612
|
+
# source://mocha//lib/mocha/configuration.rb#296
|
613
|
+
def strict_keyword_argument_matching?; end
|
606
614
|
|
607
615
|
# @private
|
608
616
|
#
|
609
|
-
# source://mocha//lib/mocha/configuration.rb#
|
617
|
+
# source://mocha//lib/mocha/configuration.rb#215
|
610
618
|
def stubbing_method_on_nil; end
|
611
619
|
|
612
620
|
# Configure whether stubbing methods on the +nil+ object is allowed.
|
@@ -621,12 +629,12 @@ class Mocha::Configuration
|
|
621
629
|
#
|
622
630
|
# @param value [Symbol] one of +:allow+, +:warn+, +:prevent+.
|
623
631
|
#
|
624
|
-
# source://mocha//lib/mocha/configuration.rb#
|
632
|
+
# source://mocha//lib/mocha/configuration.rb#210
|
625
633
|
def stubbing_method_on_nil=(value); end
|
626
634
|
|
627
635
|
# @private
|
628
636
|
#
|
629
|
-
# source://mocha//lib/mocha/configuration.rb#
|
637
|
+
# source://mocha//lib/mocha/configuration.rb#127
|
630
638
|
def stubbing_method_on_non_mock_object; end
|
631
639
|
|
632
640
|
# Configure whether stubbing methods on non-mock objects is allowed.
|
@@ -652,12 +660,12 @@ class Mocha::Configuration
|
|
652
660
|
# # => #<Example:0x593620>.example_method
|
653
661
|
# @param value [Symbol] one of +:allow+, +:warn+, +:prevent+.
|
654
662
|
#
|
655
|
-
# source://mocha//lib/mocha/configuration.rb#
|
663
|
+
# source://mocha//lib/mocha/configuration.rb#122
|
656
664
|
def stubbing_method_on_non_mock_object=(value); end
|
657
665
|
|
658
666
|
# @private
|
659
667
|
#
|
660
|
-
# source://mocha//lib/mocha/configuration.rb#
|
668
|
+
# source://mocha//lib/mocha/configuration.rb#94
|
661
669
|
def stubbing_method_unnecessarily; end
|
662
670
|
|
663
671
|
# Configure whether stubbing methods unnecessarily is allowed.
|
@@ -679,12 +687,12 @@ class Mocha::Configuration
|
|
679
687
|
# # => #<Mock:example>.unused_stub(any_parameters)
|
680
688
|
# @param value [Symbol] one of +:allow+, +:warn+, +:prevent+.
|
681
689
|
#
|
682
|
-
# source://mocha//lib/mocha/configuration.rb#
|
690
|
+
# source://mocha//lib/mocha/configuration.rb#89
|
683
691
|
def stubbing_method_unnecessarily=(value); end
|
684
692
|
|
685
693
|
# @private
|
686
694
|
#
|
687
|
-
# source://mocha//lib/mocha/configuration.rb#
|
695
|
+
# source://mocha//lib/mocha/configuration.rb#160
|
688
696
|
def stubbing_non_existent_method; end
|
689
697
|
|
690
698
|
# Configure whether stubbing of non-existent methods is allowed.
|
@@ -710,12 +718,12 @@ class Mocha::Configuration
|
|
710
718
|
# # => #<Example:0x593760>.method_that_doesnt_exist
|
711
719
|
# @param value [Symbol] one of +:allow+, +:warn+, +:prevent+.
|
712
720
|
#
|
713
|
-
# source://mocha//lib/mocha/configuration.rb#
|
721
|
+
# source://mocha//lib/mocha/configuration.rb#155
|
714
722
|
def stubbing_non_existent_method=(value); end
|
715
723
|
|
716
724
|
# @private
|
717
725
|
#
|
718
|
-
# source://mocha//lib/mocha/configuration.rb#
|
726
|
+
# source://mocha//lib/mocha/configuration.rb#194
|
719
727
|
def stubbing_non_public_method; end
|
720
728
|
|
721
729
|
# Configure whether stubbing of non-public methods is allowed.
|
@@ -742,47 +750,27 @@ class Mocha::Configuration
|
|
742
750
|
# # => #<Example:0x593530>.internal_method
|
743
751
|
# @param value [Symbol] one of +:allow+, +:warn+, +:prevent+.
|
744
752
|
#
|
745
|
-
# source://mocha//lib/mocha/configuration.rb#
|
753
|
+
# source://mocha//lib/mocha/configuration.rb#189
|
746
754
|
def stubbing_non_public_method=(value); end
|
747
755
|
|
748
756
|
protected
|
749
757
|
|
750
758
|
# Returns the value of attribute options.
|
751
759
|
#
|
752
|
-
# source://mocha//lib/mocha/configuration.rb#
|
760
|
+
# source://mocha//lib/mocha/configuration.rb#51
|
753
761
|
def options; end
|
754
762
|
|
755
763
|
private
|
756
764
|
|
757
765
|
# @private
|
758
766
|
#
|
759
|
-
# source://mocha//lib/mocha/configuration.rb#
|
767
|
+
# source://mocha//lib/mocha/configuration.rb#60
|
760
768
|
def initialize_copy(other); end
|
761
769
|
|
762
770
|
class << self
|
763
|
-
# Allow the specified +action+.
|
764
|
-
#
|
765
|
-
# @deprecated If a block is supplied, call {.override} with a +Hash+ containing an entry with the +action+ as the key and +:allow+ as the value. If no block is supplied, call the appropriate +action+ writer method with +value+ set to +:allow+ via {Mocha.configure}. The writer method will be the one of the following corresponding to the +action+:
|
766
|
-
# * {#stubbing_method_unnecessarily=}
|
767
|
-
# * {#stubbing_method_on_non_mock_object=}
|
768
|
-
# * {#stubbing_non_existent_method=}
|
769
|
-
# * {#stubbing_non_public_method=}
|
770
|
-
# * {#stubbing_method_on_nil=}
|
771
|
-
# @param action [Symbol] one of +:stubbing_method_unnecessarily+, +:stubbing_method_on_non_mock_object+, +:stubbing_non_existent_method+, +:stubbing_non_public_method+, +:stubbing_method_on_nil+.
|
772
|
-
# @yield optional block during which the configuration change will be changed before being returned to its original value at the end of the block.
|
773
|
-
#
|
774
|
-
# source://mocha//lib/mocha/configuration.rb#317
|
775
|
-
def allow(action, &block); end
|
776
|
-
|
777
771
|
# @private
|
778
|
-
# @return [Boolean]
|
779
772
|
#
|
780
773
|
# source://mocha//lib/mocha/configuration.rb#327
|
781
|
-
def allow?(action); end
|
782
|
-
|
783
|
-
# @private
|
784
|
-
#
|
785
|
-
# source://mocha//lib/mocha/configuration.rb#405
|
786
774
|
def configuration; end
|
787
775
|
|
788
776
|
# Temporarily modify {Configuration} options.
|
@@ -797,83 +785,43 @@ class Mocha::Configuration
|
|
797
785
|
# @param temporary_options [Hash] the configuration options to apply for the duration of the block.
|
798
786
|
# @yield block during which the configuration change will be in force.
|
799
787
|
#
|
800
|
-
# source://mocha//lib/mocha/configuration.rb#
|
788
|
+
# source://mocha//lib/mocha/configuration.rb#318
|
801
789
|
def override(temporary_options); end
|
802
790
|
|
803
|
-
# Raise a {StubbingError} if the specified +action+ is attempted.
|
804
|
-
#
|
805
|
-
# @deprecated If a block is supplied, call {.override} with a +Hash+ containing an entry with the +action+ as the key and +:prevent+ as the value. If no block is supplied, call the appropriate +action+ writer method with +value+ set to +:prevent+ via {Mocha.configure}. The writer method will be the one of the following corresponding to the +action+:
|
806
|
-
# * {#stubbing_method_unnecessarily=}
|
807
|
-
# * {#stubbing_method_on_non_mock_object=}
|
808
|
-
# * {#stubbing_non_existent_method=}
|
809
|
-
# * {#stubbing_non_public_method=}
|
810
|
-
# * {#stubbing_method_on_nil=}
|
811
|
-
# @param action [Symbol] one of +:stubbing_method_unnecessarily+, +:stubbing_method_on_non_mock_object+, +:stubbing_non_existent_method+, +:stubbing_non_public_method+, +:stubbing_method_on_nil+.
|
812
|
-
# @yield optional block during which the configuration change will be changed before being returned to its original value at the end of the block.
|
813
|
-
#
|
814
|
-
# source://mocha//lib/mocha/configuration.rb#365
|
815
|
-
def prevent(action, &block); end
|
816
|
-
|
817
|
-
# @private
|
818
|
-
# @return [Boolean]
|
819
|
-
#
|
820
|
-
# source://mocha//lib/mocha/configuration.rb#375
|
821
|
-
def prevent?(action); end
|
822
|
-
|
823
791
|
# @private
|
824
792
|
#
|
825
|
-
# source://mocha//lib/mocha/configuration.rb#
|
793
|
+
# source://mocha//lib/mocha/configuration.rb#302
|
826
794
|
def reset_configuration; end
|
827
795
|
|
828
|
-
# Warn if the specified +action+ is attempted.
|
829
|
-
#
|
830
|
-
# @deprecated If a block is supplied, call {.override} with a +Hash+ containing an entry with the +action+ as the key and +:warn+ as the value. If no block is supplied, call the appropriate +action+ writer method with +value+ set to +:warn+ via {Mocha.configure}. The writer method will be the one of the following corresponding to the +action+:
|
831
|
-
# * {#stubbing_method_unnecessarily=}
|
832
|
-
# * {#stubbing_method_on_non_mock_object=}
|
833
|
-
# * {#stubbing_non_existent_method=}
|
834
|
-
# * {#stubbing_non_public_method=}
|
835
|
-
# * {#stubbing_method_on_nil=}
|
836
|
-
# @param action [Symbol] one of +:stubbing_method_unnecessarily+, +:stubbing_method_on_non_mock_object+, +:stubbing_non_existent_method+, +:stubbing_non_public_method+, +:stubbing_method_on_nil+.
|
837
|
-
# @yield optional block during which the configuration change will be changed before being returned to its original value at the end of the block.
|
838
|
-
#
|
839
|
-
# source://mocha//lib/mocha/configuration.rb#341
|
840
|
-
def warn_when(action, &block); end
|
841
|
-
|
842
|
-
# @private
|
843
|
-
# @return [Boolean]
|
844
|
-
#
|
845
|
-
# source://mocha//lib/mocha/configuration.rb#351
|
846
|
-
def warn_when?(action); end
|
847
|
-
|
848
796
|
private
|
849
797
|
|
850
798
|
# @private
|
851
799
|
#
|
852
|
-
# source://mocha//lib/mocha/configuration.rb#
|
800
|
+
# source://mocha//lib/mocha/configuration.rb#334
|
853
801
|
def change_config(action, new_value, &block); end
|
854
802
|
|
855
803
|
# @private
|
856
804
|
#
|
857
|
-
# source://mocha//lib/mocha/configuration.rb#
|
805
|
+
# source://mocha//lib/mocha/configuration.rb#343
|
858
806
|
def temporarily_change_config(action, new_value); end
|
859
807
|
end
|
860
808
|
end
|
861
809
|
|
862
810
|
# @private
|
863
811
|
#
|
864
|
-
# source://mocha//lib/mocha/configuration.rb#
|
812
|
+
# source://mocha//lib/mocha/configuration.rb#41
|
865
813
|
Mocha::Configuration::DEFAULTS = T.let(T.unsafe(nil), Hash)
|
866
814
|
|
867
815
|
# source://mocha//lib/mocha/debug.rb#2
|
868
816
|
module Mocha::Debug
|
869
817
|
class << self
|
870
|
-
# source://mocha//lib/mocha/debug.rb#
|
818
|
+
# source://mocha//lib/mocha/debug.rb#5
|
871
819
|
def puts(message); end
|
872
820
|
end
|
873
821
|
end
|
874
822
|
|
875
823
|
# source://mocha//lib/mocha/debug.rb#3
|
876
|
-
Mocha::Debug::OPTIONS = T.let(T.unsafe(nil),
|
824
|
+
Mocha::Debug::OPTIONS = T.let(T.unsafe(nil), Array)
|
877
825
|
|
878
826
|
# source://mocha//lib/mocha/names.rb#32
|
879
827
|
class Mocha::DefaultName
|
@@ -929,16 +877,16 @@ class Mocha::Deprecation
|
|
929
877
|
end
|
930
878
|
end
|
931
879
|
|
932
|
-
# source://mocha//lib/mocha/detection/
|
880
|
+
# source://mocha//lib/mocha/detection/minitest.rb#2
|
933
881
|
module Mocha::Detection; end
|
934
882
|
|
935
|
-
# source://mocha//lib/mocha/detection/
|
936
|
-
module Mocha::Detection::
|
883
|
+
# source://mocha//lib/mocha/detection/minitest.rb#3
|
884
|
+
module Mocha::Detection::Minitest
|
937
885
|
class << self
|
938
|
-
# source://mocha//lib/mocha/detection/
|
886
|
+
# source://mocha//lib/mocha/detection/minitest.rb#4
|
939
887
|
def testcase; end
|
940
888
|
|
941
|
-
# source://mocha//lib/mocha/detection/
|
889
|
+
# source://mocha//lib/mocha/detection/minitest.rb#12
|
942
890
|
def version; end
|
943
891
|
end
|
944
892
|
end
|
@@ -969,27 +917,27 @@ end
|
|
969
917
|
|
970
918
|
# Methods on expectations returned from {Mock#expects}, {Mock#stubs}, {ObjectMethods#expects} and {ObjectMethods#stubs}.
|
971
919
|
#
|
972
|
-
# source://mocha//lib/mocha/expectation.rb#
|
920
|
+
# source://mocha//lib/mocha/expectation.rb#19
|
973
921
|
class Mocha::Expectation
|
974
922
|
# @private
|
975
923
|
# @return [Expectation] a new instance of Expectation
|
976
924
|
#
|
977
|
-
# source://mocha//lib/mocha/expectation.rb#
|
925
|
+
# source://mocha//lib/mocha/expectation.rb#597
|
978
926
|
def initialize(mock, expected_method_name, backtrace = T.unsafe(nil)); end
|
979
927
|
|
980
928
|
# @private
|
981
929
|
#
|
982
|
-
# source://mocha//lib/mocha/expectation.rb#
|
930
|
+
# source://mocha//lib/mocha/expectation.rb#616
|
983
931
|
def add_in_sequence_ordering_constraint(sequence); end
|
984
932
|
|
985
933
|
# @private
|
986
934
|
#
|
987
|
-
# source://mocha//lib/mocha/expectation.rb#
|
935
|
+
# source://mocha//lib/mocha/expectation.rb#611
|
988
936
|
def add_ordering_constraint(ordering_constraint); end
|
989
937
|
|
990
938
|
# @private
|
991
939
|
#
|
992
|
-
# source://mocha//lib/mocha/expectation.rb#
|
940
|
+
# source://mocha//lib/mocha/expectation.rb#621
|
993
941
|
def add_side_effect(side_effect); end
|
994
942
|
|
995
943
|
# Modifies expectation so that the expected method must be called at least a +minimum_number_of_times+.
|
@@ -1007,7 +955,7 @@ class Mocha::Expectation
|
|
1007
955
|
# @param minimum_number_of_times [Integer] minimum number of expected invocations.
|
1008
956
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1009
957
|
#
|
1010
|
-
# source://mocha//lib/mocha/expectation.rb#
|
958
|
+
# source://mocha//lib/mocha/expectation.rb#134
|
1011
959
|
def at_least(minimum_number_of_times); end
|
1012
960
|
|
1013
961
|
# Modifies expectation so that the expected method must be called at least once.
|
@@ -1023,7 +971,7 @@ class Mocha::Expectation
|
|
1023
971
|
# # => verify fails
|
1024
972
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1025
973
|
#
|
1026
|
-
# source://mocha//lib/mocha/expectation.rb#
|
974
|
+
# source://mocha//lib/mocha/expectation.rb#152
|
1027
975
|
def at_least_once; end
|
1028
976
|
|
1029
977
|
# Modifies expectation so that the expected method must be called at most a +maximum_number_of_times+.
|
@@ -1040,7 +988,7 @@ class Mocha::Expectation
|
|
1040
988
|
# @param maximum_number_of_times [Integer] maximum number of expected invocations.
|
1041
989
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1042
990
|
#
|
1043
|
-
# source://mocha//lib/mocha/expectation.rb#
|
991
|
+
# source://mocha//lib/mocha/expectation.rb#170
|
1044
992
|
def at_most(maximum_number_of_times); end
|
1045
993
|
|
1046
994
|
# Modifies expectation so that the expected method must be called at most once.
|
@@ -1056,18 +1004,23 @@ class Mocha::Expectation
|
|
1056
1004
|
# 2.times { object.expected_method } # => unexpected invocation
|
1057
1005
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1058
1006
|
#
|
1059
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1007
|
+
# source://mocha//lib/mocha/expectation.rb#188
|
1060
1008
|
def at_most_once; end
|
1061
1009
|
|
1062
1010
|
# @private
|
1063
1011
|
#
|
1064
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1012
|
+
# source://mocha//lib/mocha/expectation.rb#594
|
1065
1013
|
def backtrace; end
|
1066
1014
|
|
1015
|
+
# @private
|
1016
|
+
#
|
1017
|
+
# source://mocha//lib/mocha/expectation.rb#704
|
1018
|
+
def definition_location; end
|
1019
|
+
|
1067
1020
|
# @private
|
1068
1021
|
# @return [Boolean]
|
1069
1022
|
#
|
1070
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1023
|
+
# source://mocha//lib/mocha/expectation.rb#631
|
1071
1024
|
def in_correct_order?; end
|
1072
1025
|
|
1073
1026
|
# Constrains the expectation so that it must be invoked at the current point in the +sequence+.
|
@@ -1092,45 +1045,45 @@ class Mocha::Expectation
|
|
1092
1045
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1093
1046
|
# @see API#sequence
|
1094
1047
|
#
|
1095
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1048
|
+
# source://mocha//lib/mocha/expectation.rb#588
|
1096
1049
|
def in_sequence(sequence, *sequences); end
|
1097
1050
|
|
1098
1051
|
# @private
|
1099
1052
|
#
|
1100
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1053
|
+
# source://mocha//lib/mocha/expectation.rb#680
|
1101
1054
|
def inspect; end
|
1102
1055
|
|
1103
1056
|
# @private
|
1104
1057
|
# @return [Boolean]
|
1105
1058
|
#
|
1106
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1059
|
+
# source://mocha//lib/mocha/expectation.rb#652
|
1107
1060
|
def invocations_allowed?; end
|
1108
1061
|
|
1109
1062
|
# @private
|
1110
1063
|
#
|
1111
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1064
|
+
# source://mocha//lib/mocha/expectation.rb#662
|
1112
1065
|
def invoke(invocation); end
|
1113
1066
|
|
1114
1067
|
# @private
|
1115
1068
|
# @return [Boolean]
|
1116
1069
|
#
|
1117
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1118
|
-
def match?(invocation); end
|
1070
|
+
# source://mocha//lib/mocha/expectation.rb#646
|
1071
|
+
def match?(invocation, ignoring_order: T.unsafe(nil)); end
|
1119
1072
|
|
1120
1073
|
# @private
|
1121
1074
|
# @return [Boolean]
|
1122
1075
|
#
|
1123
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1076
|
+
# source://mocha//lib/mocha/expectation.rb#641
|
1124
1077
|
def matches_method?(method_name); end
|
1125
1078
|
|
1126
1079
|
# @private
|
1127
1080
|
#
|
1128
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1081
|
+
# source://mocha//lib/mocha/expectation.rb#697
|
1129
1082
|
def method_signature; end
|
1130
1083
|
|
1131
1084
|
# @private
|
1132
1085
|
#
|
1133
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1086
|
+
# source://mocha//lib/mocha/expectation.rb#687
|
1134
1087
|
def mocha_inspect; end
|
1135
1088
|
|
1136
1089
|
# Modifies expectation so that when the expected method is called, it yields multiple times per invocation with the specified +parameter_groups+.
|
@@ -1156,7 +1109,7 @@ class Mocha::Expectation
|
|
1156
1109
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1157
1110
|
# @see #then
|
1158
1111
|
#
|
1159
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1112
|
+
# source://mocha//lib/mocha/expectation.rb#375
|
1160
1113
|
def multiple_yields(*parameter_groups); end
|
1161
1114
|
|
1162
1115
|
# Modifies expectation so that the expected method must never be called.
|
@@ -1171,7 +1124,7 @@ class Mocha::Expectation
|
|
1171
1124
|
# # => verify succeeds
|
1172
1125
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1173
1126
|
#
|
1174
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1127
|
+
# source://mocha//lib/mocha/expectation.rb#114
|
1175
1128
|
def never; end
|
1176
1129
|
|
1177
1130
|
# Modifies expectation so that the expected method must be called exactly once.
|
@@ -1194,20 +1147,21 @@ class Mocha::Expectation
|
|
1194
1147
|
# # => verify fails
|
1195
1148
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1196
1149
|
#
|
1197
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1150
|
+
# source://mocha//lib/mocha/expectation.rb#97
|
1198
1151
|
def once; end
|
1199
1152
|
|
1200
1153
|
# @private
|
1201
1154
|
#
|
1202
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1155
|
+
# source://mocha//lib/mocha/expectation.rb#636
|
1156
|
+
def ordering_constraints_not_allowing_invocation_now; end
|
1157
|
+
|
1158
|
+
# @private
|
1159
|
+
#
|
1160
|
+
# source://mocha//lib/mocha/expectation.rb#626
|
1203
1161
|
def perform_side_effects; end
|
1204
1162
|
|
1205
1163
|
# Modifies expectation so that when the expected method is called, it raises the specified +exception+ with the specified +message+ i.e. calls +Kernel#raise(exception, message)+.
|
1206
1164
|
#
|
1207
|
-
# @example Raise specified exception if expected method is invoked.
|
1208
|
-
# object = stub()
|
1209
|
-
# object.stubs(:expected_method).raises(Exception, 'message')
|
1210
|
-
# object.expected_method # => raises exception of class Exception and with message 'message'
|
1211
1165
|
# @example Raise custom exception with extra constructor parameters by passing in an instance of the exception.
|
1212
1166
|
# object = stub()
|
1213
1167
|
# object.stubs(:expected_method).raises(MyException.new('message', 1, 2, 3))
|
@@ -1217,6 +1171,10 @@ class Mocha::Expectation
|
|
1217
1171
|
# object.stubs(:expected_method).raises(Exception1).then.raises(Exception2)
|
1218
1172
|
# object.expected_method # => raises exception of class Exception1
|
1219
1173
|
# object.expected_method # => raises exception of class Exception2
|
1174
|
+
# @example Raise specified exception if expected method is invoked.
|
1175
|
+
# object = stub()
|
1176
|
+
# object.stubs(:expected_method).raises(Exception, 'message')
|
1177
|
+
# object.expected_method # => raises exception of class Exception and with message 'message'
|
1220
1178
|
# @example Raise an exception on first invocation of expected method and then return values on subsequent invocations.
|
1221
1179
|
# object = stub()
|
1222
1180
|
# object.stubs(:expected_method).raises(Exception).then.returns(2, 3)
|
@@ -1232,7 +1190,7 @@ class Mocha::Expectation
|
|
1232
1190
|
# @see Kernel#raise
|
1233
1191
|
# @see #then
|
1234
1192
|
#
|
1235
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1193
|
+
# source://mocha//lib/mocha/expectation.rb#462
|
1236
1194
|
def raises(exception = T.unsafe(nil), message = T.unsafe(nil)); end
|
1237
1195
|
|
1238
1196
|
# Modifies expectation so that when the expected method is called, it returns the specified +value+.
|
@@ -1270,13 +1228,13 @@ class Mocha::Expectation
|
|
1270
1228
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1271
1229
|
# @see #then
|
1272
1230
|
#
|
1273
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1231
|
+
# source://mocha//lib/mocha/expectation.rb#422
|
1274
1232
|
def returns(*values); end
|
1275
1233
|
|
1276
1234
|
# @private
|
1277
1235
|
# @return [Boolean]
|
1278
1236
|
#
|
1279
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1237
|
+
# source://mocha//lib/mocha/expectation.rb#657
|
1280
1238
|
def satisfied?; end
|
1281
1239
|
|
1282
1240
|
# @example Using {#then} as syntactic sugar when specifying values to be returned and exceptions to be raised on consecutive invocations of the expected method.
|
@@ -1300,19 +1258,19 @@ class Mocha::Expectation
|
|
1300
1258
|
# @overload then
|
1301
1259
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1302
1260
|
#
|
1303
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1261
|
+
# source://mocha//lib/mocha/expectation.rb#536
|
1304
1262
|
def then(state = T.unsafe(nil)); end
|
1305
1263
|
|
1306
1264
|
# Modifies expectation so that when the expected method is called, it throws the specified +tag+ with the specific return value +object+ i.e. calls +Kernel#throw(tag, object)+.
|
1307
1265
|
#
|
1308
|
-
# @example Throw tag when expected method is invoked.
|
1309
|
-
# object = stub()
|
1310
|
-
# object.stubs(:expected_method).throws(:done)
|
1311
|
-
# object.expected_method # => throws tag :done
|
1312
1266
|
# @example Throw tag with return value +object+ c.f. +Kernel#throw+.
|
1313
1267
|
# object = stub()
|
1314
1268
|
# object.stubs(:expected_method).throws(:done, 'result')
|
1315
1269
|
# object.expected_method # => throws tag :done and causes catch block to return 'result'
|
1270
|
+
# @example Throw tag when expected method is invoked.
|
1271
|
+
# object = stub()
|
1272
|
+
# object.stubs(:expected_method).throws(:done)
|
1273
|
+
# object.expected_method # => throws tag :done
|
1316
1274
|
# @example Throw different tags on consecutive invocations of the expected method.
|
1317
1275
|
# object = stub()
|
1318
1276
|
# object.stubs(:expected_method).throws(:done).then.throws(:continue)
|
@@ -1332,7 +1290,7 @@ class Mocha::Expectation
|
|
1332
1290
|
# @see Kernel#throw
|
1333
1291
|
# @see #then
|
1334
1292
|
#
|
1335
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1293
|
+
# source://mocha//lib/mocha/expectation.rb#501
|
1336
1294
|
def throws(tag, object = T.unsafe(nil)); end
|
1337
1295
|
|
1338
1296
|
# Modifies expectation so that the number of calls to the expected method must be within a specific +range+.
|
@@ -1360,7 +1318,7 @@ class Mocha::Expectation
|
|
1360
1318
|
# @param range [Range, Integer] specifies the allowable range in the number of expected invocations.
|
1361
1319
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1362
1320
|
#
|
1363
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1321
|
+
# source://mocha//lib/mocha/expectation.rb#46
|
1364
1322
|
def times(range); end
|
1365
1323
|
|
1366
1324
|
# Modifies expectation so that the expected method must be called exactly twice.
|
@@ -1384,19 +1342,19 @@ class Mocha::Expectation
|
|
1384
1342
|
# # => verify fails
|
1385
1343
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1386
1344
|
#
|
1387
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1345
|
+
# source://mocha//lib/mocha/expectation.rb#72
|
1388
1346
|
def twice; end
|
1389
1347
|
|
1390
1348
|
# @private
|
1391
1349
|
# @return [Boolean]
|
1392
1350
|
#
|
1393
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1351
|
+
# source://mocha//lib/mocha/expectation.rb#675
|
1394
1352
|
def used?; end
|
1395
1353
|
|
1396
1354
|
# @private
|
1397
1355
|
# @return [Boolean]
|
1398
1356
|
#
|
1399
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1357
|
+
# source://mocha//lib/mocha/expectation.rb#669
|
1400
1358
|
def verified?(assertion_counter = T.unsafe(nil)); end
|
1401
1359
|
|
1402
1360
|
# Constrains the expectation to occur only when the +state_machine+ is in the state specified by +state_predicate+.
|
@@ -1417,14 +1375,20 @@ class Mocha::Expectation
|
|
1417
1375
|
# @see StateMachine
|
1418
1376
|
# @see #then
|
1419
1377
|
#
|
1420
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1378
|
+
# source://mocha//lib/mocha/expectation.rb#560
|
1421
1379
|
def when(state_predicate); end
|
1422
1380
|
|
1423
|
-
# Modifies expectation so that the expected method must be called with +
|
1381
|
+
# Modifies expectation so that the expected method must be called with +expected_parameters_or_matchers+.
|
1382
|
+
#
|
1383
|
+
# May be used with Ruby literals or variables for exact matching or with parameter matchers for less-specific matching, e.g. {ParameterMatchers#includes}, {ParameterMatchers#has_key}, etc. See {ParameterMatchers} for a list of all available parameter matchers.
|
1384
|
+
#
|
1385
|
+
# Positional arguments were separated from keyword arguments in Ruby v3 (see {https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0 this article}). In relation to this a new configuration option ({Configuration#strict_keyword_argument_matching=}) is available in Ruby >= 2.7.
|
1424
1386
|
#
|
1425
|
-
#
|
1387
|
+
# When {Configuration#strict_keyword_argument_matching=} is set to +false+ (which is currently the default), a positional +Hash+ and a set of keyword arguments passed to {#with} are treated the same for the purposes of parameter matching. However, a deprecation warning will be displayed if a positional +Hash+ matches a set of keyword arguments or vice versa. This is because {Configuration#strict_keyword_argument_matching=} will default to +true+ in the future.
|
1426
1388
|
#
|
1427
|
-
#
|
1389
|
+
# When {Configuration#strict_keyword_argument_matching=} is set to +true+, an actual positional +Hash+ will not match an expected set of keyword arguments; and vice versa, an actual set of keyword arguments will not match an expected positional +Hash+, i.e. the parameter matching is stricter.
|
1390
|
+
#
|
1391
|
+
# @example Expected method must be called with exact parameter values.
|
1428
1392
|
# object = mock()
|
1429
1393
|
# object.expects(:expected_method).with(:param1, :param2)
|
1430
1394
|
# object.expected_method(:param1, :param2)
|
@@ -1434,6 +1398,40 @@ class Mocha::Expectation
|
|
1434
1398
|
# object.expects(:expected_method).with(:param1, :param2)
|
1435
1399
|
# object.expected_method(:param3)
|
1436
1400
|
# # => verify fails
|
1401
|
+
# @example Expected method must be called with parameters matching parameter matchers.
|
1402
|
+
# object = mock()
|
1403
|
+
# object.expects(:expected_method).with(includes('string2'), anything)
|
1404
|
+
# object.expected_method(['string1', 'string2'], 'any-old-value')
|
1405
|
+
# # => verify succeeds
|
1406
|
+
#
|
1407
|
+
# object = mock()
|
1408
|
+
# object.expects(:expected_method).with(includes('string2'), anything)
|
1409
|
+
# object.expected_method(['string1'], 'any-old-value')
|
1410
|
+
# # => verify fails
|
1411
|
+
# @example Loose keyword argument matching (default)
|
1412
|
+
#
|
1413
|
+
# class Example
|
1414
|
+
# def foo(a, bar:); end
|
1415
|
+
# end
|
1416
|
+
#
|
1417
|
+
# example = Example.new
|
1418
|
+
# example.expects(:foo).with('a', bar: 'b')
|
1419
|
+
# example.foo('a', { bar: 'b' })
|
1420
|
+
# # This passes the test, but would result in an ArgumentError in practice
|
1421
|
+
# @example Strict keyword argument matching
|
1422
|
+
#
|
1423
|
+
# Mocha.configure do |c|
|
1424
|
+
# c.strict_keyword_argument_matching = true
|
1425
|
+
# end
|
1426
|
+
#
|
1427
|
+
# class Example
|
1428
|
+
# def foo(a, bar:); end
|
1429
|
+
# end
|
1430
|
+
#
|
1431
|
+
# example = Example.new
|
1432
|
+
# example.expects(:foo).with('a', bar: 'b')
|
1433
|
+
# example.foo('a', { bar: 'b' })
|
1434
|
+
# # This now fails as expected
|
1437
1435
|
# @example Expected method must be called with a value divisible by 4.
|
1438
1436
|
# object = mock()
|
1439
1437
|
# object.expects(:expected_method).with() { |value| value % 4 == 0 }
|
@@ -1444,14 +1442,16 @@ class Mocha::Expectation
|
|
1444
1442
|
# object.expects(:expected_method).with() { |value| value % 4 == 0 }
|
1445
1443
|
# object.expected_method(17)
|
1446
1444
|
# # => verify fails
|
1447
|
-
# @param
|
1445
|
+
# @param expected_parameters_or_matchers [*Array<Object,ParameterMatchers::Base>] expected parameter values or parameter matchers.
|
1448
1446
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1447
|
+
# @see ParameterMatchers
|
1448
|
+
# @see Configuration#strict_keyword_argument_matching=
|
1449
1449
|
# @yield optional block specifying custom matching.
|
1450
|
-
# @yieldparam actual_parameters [*Array] parameters with which expected method was invoked.
|
1450
|
+
# @yieldparam actual_parameters [*Array<Object>] parameters with which expected method was invoked.
|
1451
1451
|
# @yieldreturn [Boolean] +true+ if +actual_parameters+ are acceptable.
|
1452
1452
|
#
|
1453
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1454
|
-
def with(*
|
1453
|
+
# source://mocha//lib/mocha/expectation.rb#269
|
1454
|
+
def with(*expected_parameters_or_matchers, **_arg1, &matching_block); end
|
1455
1455
|
|
1456
1456
|
# Modifies expectation so that the expected method must be called with a block.
|
1457
1457
|
#
|
@@ -1467,7 +1467,7 @@ class Mocha::Expectation
|
|
1467
1467
|
# # => verify fails
|
1468
1468
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1469
1469
|
#
|
1470
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1470
|
+
# source://mocha//lib/mocha/expectation.rb#289
|
1471
1471
|
def with_block_given; end
|
1472
1472
|
|
1473
1473
|
# Modifies expectation so that the expected method must be called without a block.
|
@@ -1484,7 +1484,7 @@ class Mocha::Expectation
|
|
1484
1484
|
# # => verify fails
|
1485
1485
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1486
1486
|
#
|
1487
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1487
|
+
# source://mocha//lib/mocha/expectation.rb#308
|
1488
1488
|
def with_no_block_given; end
|
1489
1489
|
|
1490
1490
|
# Modifies expectation so that when the expected method is called, it yields to the block with the specified +parameters+.
|
@@ -1519,7 +1519,7 @@ class Mocha::Expectation
|
|
1519
1519
|
# @return [Expectation] the same expectation, thereby allowing invocations of other {Expectation} methods to be chained.
|
1520
1520
|
# @see #then
|
1521
1521
|
#
|
1522
|
-
# source://mocha//lib/mocha/expectation.rb#
|
1522
|
+
# source://mocha//lib/mocha/expectation.rb#347
|
1523
1523
|
def yields(*parameters); end
|
1524
1524
|
end
|
1525
1525
|
|
@@ -1536,9 +1536,9 @@ class Mocha::ExpectationError < ::Exception; end
|
|
1536
1536
|
#
|
1537
1537
|
# This class should only be used by authors of test libraries and not by typical "users" of Mocha.
|
1538
1538
|
#
|
1539
|
-
# For example, it is used by +Mocha::Integration::
|
1539
|
+
# For example, it is used by +Mocha::Integration::Minitest::Adapter+ in order to have Mocha raise a +Minitest::Assertion+ which can then be sensibly handled by +Minitest::Unit::TestCase+.
|
1540
1540
|
#
|
1541
|
-
# @see Mocha::Integration::
|
1541
|
+
# @see Mocha::Integration::Minitest::Adapter
|
1542
1542
|
#
|
1543
1543
|
# source://mocha//lib/mocha/expectation_error_factory.rb#12
|
1544
1544
|
class Mocha::ExpectationErrorFactory
|
@@ -1576,7 +1576,7 @@ class Mocha::ExpectationList
|
|
1576
1576
|
# source://mocha//lib/mocha/expectation_list.rb#3
|
1577
1577
|
def initialize(expectations = T.unsafe(nil)); end
|
1578
1578
|
|
1579
|
-
# source://mocha//lib/mocha/expectation_list.rb#
|
1579
|
+
# source://mocha//lib/mocha/expectation_list.rb#52
|
1580
1580
|
def +(other); end
|
1581
1581
|
|
1582
1582
|
# source://mocha//lib/mocha/expectation_list.rb#7
|
@@ -1584,18 +1584,21 @@ class Mocha::ExpectationList
|
|
1584
1584
|
|
1585
1585
|
# @return [Boolean]
|
1586
1586
|
#
|
1587
|
-
# source://mocha//lib/mocha/expectation_list.rb#
|
1587
|
+
# source://mocha//lib/mocha/expectation_list.rb#48
|
1588
1588
|
def any?; end
|
1589
1589
|
|
1590
|
-
# source://mocha//lib/mocha/expectation_list.rb#
|
1590
|
+
# source://mocha//lib/mocha/expectation_list.rb#44
|
1591
1591
|
def length; end
|
1592
1592
|
|
1593
1593
|
# source://mocha//lib/mocha/expectation_list.rb#20
|
1594
|
-
def match(invocation); end
|
1594
|
+
def match(invocation, ignoring_order: T.unsafe(nil)); end
|
1595
1595
|
|
1596
|
-
# source://mocha//lib/mocha/expectation_list.rb#
|
1596
|
+
# source://mocha//lib/mocha/expectation_list.rb#28
|
1597
1597
|
def match_allowing_invocation(invocation); end
|
1598
1598
|
|
1599
|
+
# source://mocha//lib/mocha/expectation_list.rb#24
|
1600
|
+
def match_but_out_of_order(invocation); end
|
1601
|
+
|
1599
1602
|
# @return [Boolean]
|
1600
1603
|
#
|
1601
1604
|
# source://mocha//lib/mocha/expectation_list.rb#16
|
@@ -1604,21 +1607,21 @@ class Mocha::ExpectationList
|
|
1604
1607
|
# source://mocha//lib/mocha/expectation_list.rb#12
|
1605
1608
|
def remove_all_matching_method(method_name); end
|
1606
1609
|
|
1607
|
-
# source://mocha//lib/mocha/expectation_list.rb#
|
1610
|
+
# source://mocha//lib/mocha/expectation_list.rb#36
|
1608
1611
|
def to_a; end
|
1609
1612
|
|
1610
|
-
# source://mocha//lib/mocha/expectation_list.rb#
|
1613
|
+
# source://mocha//lib/mocha/expectation_list.rb#40
|
1611
1614
|
def to_set; end
|
1612
1615
|
|
1613
1616
|
# @return [Boolean]
|
1614
1617
|
#
|
1615
|
-
# source://mocha//lib/mocha/expectation_list.rb#
|
1618
|
+
# source://mocha//lib/mocha/expectation_list.rb#32
|
1616
1619
|
def verified?(assertion_counter = T.unsafe(nil)); end
|
1617
1620
|
|
1618
1621
|
private
|
1619
1622
|
|
1620
|
-
# source://mocha//lib/mocha/expectation_list.rb#
|
1621
|
-
def matching_expectations(invocation); end
|
1623
|
+
# source://mocha//lib/mocha/expectation_list.rb#58
|
1624
|
+
def matching_expectations(invocation, ignoring_order: T.unsafe(nil)); end
|
1622
1625
|
end
|
1623
1626
|
|
1624
1627
|
# Integration hooks for test library authors.
|
@@ -1627,12 +1630,12 @@ end
|
|
1627
1630
|
#
|
1628
1631
|
# This module is provided as part of the +Mocha::API+ module and is therefore part of the public API, but should only be used by authors of test libraries and not by typical "users" of Mocha.
|
1629
1632
|
#
|
1630
|
-
# Integration with Test::Unit and
|
1633
|
+
# Integration with Test::Unit and Minitest are provided as part of Mocha, because they are (or were once) part of the Ruby standard library. Integration with other test libraries is not provided as *part* of Mocha, but is supported by means of the methods in this module.
|
1631
1634
|
#
|
1632
1635
|
# See the code in the +Adapter+ modules for examples of how to use the methods in this module. +Mocha::ExpectationErrorFactory+ may be used if you want +Mocha+ to raise a different type of exception.
|
1633
1636
|
#
|
1634
1637
|
# @see Mocha::Integration::TestUnit::Adapter
|
1635
|
-
# @see Mocha::Integration::
|
1638
|
+
# @see Mocha::Integration::Minitest::Adapter
|
1636
1639
|
# @see Mocha::ExpectationErrorFactory
|
1637
1640
|
# @see Mocha::API
|
1638
1641
|
#
|
@@ -1650,7 +1653,13 @@ module Mocha::Hooks
|
|
1650
1653
|
# This method should be called after each individual test has finished (including after any "teardown" code).
|
1651
1654
|
#
|
1652
1655
|
# source://mocha//lib/mocha/hooks.rb#38
|
1653
|
-
def mocha_teardown; end
|
1656
|
+
def mocha_teardown(origin = T.unsafe(nil)); end
|
1657
|
+
|
1658
|
+
# Returns a string representing the unit test name, to be included in some Mocha
|
1659
|
+
# to help track down potential bugs.
|
1660
|
+
#
|
1661
|
+
# source://mocha//lib/mocha/hooks.rb#44
|
1662
|
+
def mocha_test_name; end
|
1654
1663
|
|
1655
1664
|
# Verifies that all mock expectations have been met (only for use by authors of test libraries).
|
1656
1665
|
#
|
@@ -1709,16 +1718,16 @@ module Mocha::Inspect::ArrayMethods
|
|
1709
1718
|
def mocha_inspect(wrapped = T.unsafe(nil)); end
|
1710
1719
|
end
|
1711
1720
|
|
1712
|
-
# source://mocha//lib/mocha/inspect.rb#
|
1721
|
+
# source://mocha//lib/mocha/inspect.rb#44
|
1713
1722
|
module Mocha::Inspect::DateMethods
|
1714
|
-
# source://mocha//lib/mocha/inspect.rb#
|
1723
|
+
# source://mocha//lib/mocha/inspect.rb#45
|
1715
1724
|
def mocha_inspect; end
|
1716
1725
|
end
|
1717
1726
|
|
1718
1727
|
# source://mocha//lib/mocha/inspect.rb#20
|
1719
1728
|
module Mocha::Inspect::HashMethods
|
1720
1729
|
# source://mocha//lib/mocha/inspect.rb#21
|
1721
|
-
def mocha_inspect
|
1730
|
+
def mocha_inspect; end
|
1722
1731
|
end
|
1723
1732
|
|
1724
1733
|
# source://mocha//lib/mocha/inspect.rb#5
|
@@ -1727,9 +1736,9 @@ module Mocha::Inspect::ObjectMethods
|
|
1727
1736
|
def mocha_inspect; end
|
1728
1737
|
end
|
1729
1738
|
|
1730
|
-
# source://mocha//lib/mocha/inspect.rb#
|
1739
|
+
# source://mocha//lib/mocha/inspect.rb#38
|
1731
1740
|
module Mocha::Inspect::TimeMethods
|
1732
|
-
# source://mocha//lib/mocha/inspect.rb#
|
1741
|
+
# source://mocha//lib/mocha/inspect.rb#39
|
1733
1742
|
def mocha_inspect; end
|
1734
1743
|
end
|
1735
1744
|
|
@@ -1737,20 +1746,17 @@ end
|
|
1737
1746
|
class Mocha::InstanceMethod < ::Mocha::StubbedMethod
|
1738
1747
|
private
|
1739
1748
|
|
1740
|
-
# source://mocha//lib/mocha/instance_method.rb#11
|
1741
|
-
def method_body(method); end
|
1742
|
-
|
1743
1749
|
# source://mocha//lib/mocha/instance_method.rb#7
|
1744
1750
|
def mock_owner; end
|
1745
1751
|
|
1746
|
-
# source://mocha//lib/mocha/instance_method.rb#
|
1752
|
+
# source://mocha//lib/mocha/instance_method.rb#15
|
1747
1753
|
def original_method_owner; end
|
1748
1754
|
|
1749
|
-
# source://mocha//lib/mocha/instance_method.rb#
|
1755
|
+
# source://mocha//lib/mocha/instance_method.rb#11
|
1750
1756
|
def stubbee_method(method_name); end
|
1751
1757
|
end
|
1752
1758
|
|
1753
|
-
# source://mocha//lib/mocha/integration/
|
1759
|
+
# source://mocha//lib/mocha/integration/assertion_counter.rb#2
|
1754
1760
|
module Mocha::Integration; end
|
1755
1761
|
|
1756
1762
|
# source://mocha//lib/mocha/integration/assertion_counter.rb#3
|
@@ -1764,365 +1770,112 @@ class Mocha::Integration::AssertionCounter
|
|
1764
1770
|
def increment; end
|
1765
1771
|
end
|
1766
1772
|
|
1767
|
-
# source://mocha//lib/mocha/integration/
|
1768
|
-
module Mocha::Integration::
|
1773
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#7
|
1774
|
+
module Mocha::Integration::Minitest
|
1769
1775
|
class << self
|
1770
|
-
# source://mocha//lib/mocha/integration/
|
1776
|
+
# source://mocha//lib/mocha/integration/minitest.rb#8
|
1771
1777
|
def activate; end
|
1772
|
-
|
1773
|
-
# source://mocha//lib/mocha/integration/mini_test/exception_translation.rb#6
|
1774
|
-
def translate(exception); end
|
1775
1778
|
end
|
1776
1779
|
end
|
1777
1780
|
|
1778
|
-
# Integrates Mocha into recent versions of
|
1781
|
+
# Integrates Mocha into recent versions of Minitest.
|
1779
1782
|
#
|
1780
1783
|
# See the source code for an example of how to integrate Mocha into a test library.
|
1781
1784
|
#
|
1782
|
-
# source://mocha//lib/mocha/integration/
|
1783
|
-
module Mocha::Integration::
|
1785
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#11
|
1786
|
+
module Mocha::Integration::Minitest::Adapter
|
1784
1787
|
include ::Mocha::ParameterMatchers
|
1785
1788
|
include ::Mocha::Hooks
|
1786
1789
|
include ::Mocha::API
|
1787
1790
|
|
1788
1791
|
# @private
|
1789
1792
|
#
|
1790
|
-
# source://mocha//lib/mocha/integration/
|
1793
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#45
|
1791
1794
|
def after_teardown; end
|
1792
1795
|
|
1793
1796
|
# @private
|
1794
1797
|
#
|
1795
|
-
# source://mocha//lib/mocha/integration/
|
1798
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#30
|
1796
1799
|
def before_setup; end
|
1797
1800
|
|
1798
1801
|
# @private
|
1799
1802
|
#
|
1800
|
-
# source://mocha//lib/mocha/integration/
|
1803
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#36
|
1801
1804
|
def before_teardown; end
|
1802
1805
|
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
# source://mocha//lib/mocha/integration/mini_test/adapter.rb#15
|
1808
|
-
def applicable_to?(mini_test_version); end
|
1809
|
-
|
1810
|
-
# @private
|
1811
|
-
#
|
1812
|
-
# source://mocha//lib/mocha/integration/mini_test/adapter.rb#20
|
1813
|
-
def description; end
|
1814
|
-
|
1815
|
-
# @private
|
1816
|
-
# @private
|
1817
|
-
#
|
1818
|
-
# source://mocha//lib/mocha/integration/mini_test/adapter.rb#25
|
1819
|
-
def included(_mod); end
|
1820
|
-
end
|
1821
|
-
end
|
1822
|
-
|
1823
|
-
# source://mocha//lib/mocha/integration/mini_test/nothing.rb#4
|
1824
|
-
module Mocha::Integration::MiniTest::Nothing
|
1825
|
-
class << self
|
1826
|
-
# @return [Boolean]
|
1827
|
-
#
|
1828
|
-
# source://mocha//lib/mocha/integration/mini_test/nothing.rb#5
|
1829
|
-
def applicable_to?(_test_unit_version, _ruby_version = T.unsafe(nil)); end
|
1830
|
-
|
1831
|
-
# source://mocha//lib/mocha/integration/mini_test/nothing.rb#9
|
1832
|
-
def description; end
|
1833
|
-
|
1834
|
-
# @private
|
1835
|
-
#
|
1836
|
-
# source://mocha//lib/mocha/integration/mini_test/nothing.rb#13
|
1837
|
-
def included(_mod); end
|
1838
|
-
end
|
1839
|
-
end
|
1840
|
-
|
1841
|
-
# source://mocha//lib/mocha/integration/mini_test/version_13.rb#8
|
1842
|
-
module Mocha::Integration::MiniTest::Version13
|
1843
|
-
include ::Mocha::API
|
1844
|
-
|
1845
|
-
class << self
|
1846
|
-
# @return [Boolean]
|
1847
|
-
#
|
1848
|
-
# source://mocha//lib/mocha/integration/mini_test/version_13.rb#9
|
1849
|
-
def applicable_to?(mini_test_version); end
|
1850
|
-
|
1851
|
-
# source://mocha//lib/mocha/integration/mini_test/version_13.rb#13
|
1852
|
-
def description; end
|
1853
|
-
|
1854
|
-
# @private
|
1855
|
-
#
|
1856
|
-
# source://mocha//lib/mocha/integration/mini_test/version_13.rb#17
|
1857
|
-
def included(mod); end
|
1858
|
-
end
|
1859
|
-
end
|
1860
|
-
|
1861
|
-
# source://mocha//lib/mocha/integration/mini_test/version_13.rb#21
|
1862
|
-
module Mocha::Integration::MiniTest::Version13::RunMethodPatch
|
1863
|
-
# source://mocha//lib/mocha/integration/mini_test/version_13.rb#23
|
1864
|
-
def run(runner); end
|
1865
|
-
end
|
1866
|
-
|
1867
|
-
# source://mocha//lib/mocha/integration/mini_test/version_140.rb#8
|
1868
|
-
module Mocha::Integration::MiniTest::Version140
|
1869
|
-
include ::Mocha::API
|
1870
|
-
|
1871
|
-
class << self
|
1872
|
-
# @return [Boolean]
|
1873
|
-
#
|
1874
|
-
# source://mocha//lib/mocha/integration/mini_test/version_140.rb#9
|
1875
|
-
def applicable_to?(mini_test_version); end
|
1876
|
-
|
1877
|
-
# source://mocha//lib/mocha/integration/mini_test/version_140.rb#13
|
1878
|
-
def description; end
|
1879
|
-
|
1880
|
-
# @private
|
1881
|
-
#
|
1882
|
-
# source://mocha//lib/mocha/integration/mini_test/version_140.rb#17
|
1883
|
-
def included(mod); end
|
1884
|
-
end
|
1885
|
-
end
|
1886
|
-
|
1887
|
-
# source://mocha//lib/mocha/integration/mini_test/version_140.rb#21
|
1888
|
-
module Mocha::Integration::MiniTest::Version140::RunMethodPatch
|
1889
|
-
# source://mocha//lib/mocha/integration/mini_test/version_140.rb#23
|
1890
|
-
def run(runner); end
|
1891
|
-
end
|
1892
|
-
|
1893
|
-
# source://mocha//lib/mocha/integration/mini_test/version_141.rb#8
|
1894
|
-
module Mocha::Integration::MiniTest::Version141
|
1895
|
-
include ::Mocha::API
|
1896
|
-
|
1897
|
-
class << self
|
1898
|
-
# @return [Boolean]
|
1899
|
-
#
|
1900
|
-
# source://mocha//lib/mocha/integration/mini_test/version_141.rb#9
|
1901
|
-
def applicable_to?(mini_test_version); end
|
1902
|
-
|
1903
|
-
# source://mocha//lib/mocha/integration/mini_test/version_141.rb#13
|
1904
|
-
def description; end
|
1905
|
-
|
1906
|
-
# @private
|
1907
|
-
#
|
1908
|
-
# source://mocha//lib/mocha/integration/mini_test/version_141.rb#17
|
1909
|
-
def included(mod); end
|
1910
|
-
end
|
1911
|
-
end
|
1912
|
-
|
1913
|
-
# source://mocha//lib/mocha/integration/mini_test/version_141.rb#21
|
1914
|
-
module Mocha::Integration::MiniTest::Version141::RunMethodPatch
|
1915
|
-
# source://mocha//lib/mocha/integration/mini_test/version_141.rb#23
|
1916
|
-
def run(runner); end
|
1917
|
-
end
|
1918
|
-
|
1919
|
-
# source://mocha//lib/mocha/integration/mini_test/version_142_to_172.rb#8
|
1920
|
-
module Mocha::Integration::MiniTest::Version142To172
|
1921
|
-
include ::Mocha::API
|
1922
|
-
|
1923
|
-
class << self
|
1924
|
-
# @return [Boolean]
|
1925
|
-
#
|
1926
|
-
# source://mocha//lib/mocha/integration/mini_test/version_142_to_172.rb#9
|
1927
|
-
def applicable_to?(mini_test_version); end
|
1928
|
-
|
1929
|
-
# source://mocha//lib/mocha/integration/mini_test/version_142_to_172.rb#13
|
1930
|
-
def description; end
|
1931
|
-
|
1932
|
-
# @private
|
1933
|
-
#
|
1934
|
-
# source://mocha//lib/mocha/integration/mini_test/version_142_to_172.rb#17
|
1935
|
-
def included(mod); end
|
1936
|
-
end
|
1937
|
-
end
|
1938
|
-
|
1939
|
-
# source://mocha//lib/mocha/integration/mini_test/version_142_to_172.rb#21
|
1940
|
-
module Mocha::Integration::MiniTest::Version142To172::RunMethodPatch
|
1941
|
-
# source://mocha//lib/mocha/integration/mini_test/version_142_to_172.rb#23
|
1942
|
-
def run(runner); end
|
1943
|
-
end
|
1944
|
-
|
1945
|
-
# source://mocha//lib/mocha/integration/mini_test/version_200.rb#8
|
1946
|
-
module Mocha::Integration::MiniTest::Version200
|
1947
|
-
include ::Mocha::API
|
1948
|
-
|
1949
|
-
class << self
|
1950
|
-
# @return [Boolean]
|
1951
|
-
#
|
1952
|
-
# source://mocha//lib/mocha/integration/mini_test/version_200.rb#9
|
1953
|
-
def applicable_to?(mini_test_version); end
|
1954
|
-
|
1955
|
-
# source://mocha//lib/mocha/integration/mini_test/version_200.rb#13
|
1956
|
-
def description; end
|
1957
|
-
|
1958
|
-
# @private
|
1959
|
-
#
|
1960
|
-
# source://mocha//lib/mocha/integration/mini_test/version_200.rb#17
|
1961
|
-
def included(mod); end
|
1962
|
-
end
|
1963
|
-
end
|
1964
|
-
|
1965
|
-
# source://mocha//lib/mocha/integration/mini_test/version_200.rb#21
|
1966
|
-
module Mocha::Integration::MiniTest::Version200::RunMethodPatch
|
1967
|
-
# source://mocha//lib/mocha/integration/mini_test/version_200.rb#23
|
1968
|
-
def run(runner); end
|
1969
|
-
end
|
1970
|
-
|
1971
|
-
# source://mocha//lib/mocha/integration/mini_test/version_201_to_222.rb#8
|
1972
|
-
module Mocha::Integration::MiniTest::Version201To222
|
1973
|
-
include ::Mocha::API
|
1806
|
+
# @private
|
1807
|
+
#
|
1808
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#51
|
1809
|
+
def mocha_test_name; end
|
1974
1810
|
|
1975
1811
|
class << self
|
1976
|
-
# @return [Boolean]
|
1977
|
-
#
|
1978
|
-
# source://mocha//lib/mocha/integration/mini_test/version_201_to_222.rb#9
|
1979
|
-
def applicable_to?(mini_test_version); end
|
1980
|
-
|
1981
|
-
# source://mocha//lib/mocha/integration/mini_test/version_201_to_222.rb#13
|
1982
|
-
def description; end
|
1983
|
-
|
1984
1812
|
# @private
|
1985
|
-
#
|
1986
|
-
# source://mocha//lib/mocha/integration/mini_test/version_201_to_222.rb#17
|
1987
|
-
def included(mod); end
|
1988
|
-
end
|
1989
|
-
end
|
1990
|
-
|
1991
|
-
# source://mocha//lib/mocha/integration/mini_test/version_201_to_222.rb#21
|
1992
|
-
module Mocha::Integration::MiniTest::Version201To222::RunMethodPatch
|
1993
|
-
# source://mocha//lib/mocha/integration/mini_test/version_201_to_222.rb#23
|
1994
|
-
def run(runner); end
|
1995
|
-
end
|
1996
|
-
|
1997
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2110_to_2111.rb#8
|
1998
|
-
module Mocha::Integration::MiniTest::Version2110To2111
|
1999
|
-
include ::Mocha::API
|
2000
|
-
|
2001
|
-
class << self
|
2002
1813
|
# @return [Boolean]
|
2003
1814
|
#
|
2004
|
-
# source://mocha//lib/mocha/integration/
|
2005
|
-
def applicable_to?(
|
2006
|
-
|
2007
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2110_to_2111.rb#13
|
2008
|
-
def description; end
|
1815
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#15
|
1816
|
+
def applicable_to?(minitest_version); end
|
2009
1817
|
|
2010
1818
|
# @private
|
2011
1819
|
#
|
2012
|
-
# source://mocha//lib/mocha/integration/
|
2013
|
-
def included(mod); end
|
2014
|
-
end
|
2015
|
-
end
|
2016
|
-
|
2017
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2110_to_2111.rb#21
|
2018
|
-
module Mocha::Integration::MiniTest::Version2110To2111::RunMethodPatch
|
2019
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2110_to_2111.rb#23
|
2020
|
-
def run(runner); end
|
2021
|
-
end
|
2022
|
-
|
2023
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2112_to_320.rb#8
|
2024
|
-
module Mocha::Integration::MiniTest::Version2112To320
|
2025
|
-
include ::Mocha::API
|
2026
|
-
|
2027
|
-
class << self
|
2028
|
-
# @return [Boolean]
|
2029
|
-
#
|
2030
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2112_to_320.rb#9
|
2031
|
-
def applicable_to?(mini_test_version); end
|
2032
|
-
|
2033
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2112_to_320.rb#13
|
1820
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#20
|
2034
1821
|
def description; end
|
2035
1822
|
|
2036
1823
|
# @private
|
2037
|
-
#
|
2038
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2112_to_320.rb#17
|
2039
|
-
def included(mod); end
|
2040
|
-
end
|
2041
|
-
end
|
2042
|
-
|
2043
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2112_to_320.rb#21
|
2044
|
-
module Mocha::Integration::MiniTest::Version2112To320::RunMethodPatch
|
2045
|
-
# source://mocha//lib/mocha/integration/mini_test/version_2112_to_320.rb#23
|
2046
|
-
def run(runner); end
|
2047
|
-
end
|
2048
|
-
|
2049
|
-
# source://mocha//lib/mocha/integration/mini_test/version_230_to_2101.rb#8
|
2050
|
-
module Mocha::Integration::MiniTest::Version230To2101
|
2051
|
-
include ::Mocha::API
|
2052
|
-
|
2053
|
-
class << self
|
2054
|
-
# @return [Boolean]
|
2055
|
-
#
|
2056
|
-
# source://mocha//lib/mocha/integration/mini_test/version_230_to_2101.rb#9
|
2057
|
-
def applicable_to?(mini_test_version); end
|
2058
|
-
|
2059
|
-
# source://mocha//lib/mocha/integration/mini_test/version_230_to_2101.rb#13
|
2060
|
-
def description; end
|
2061
|
-
|
2062
1824
|
# @private
|
2063
1825
|
#
|
2064
|
-
# source://mocha//lib/mocha/integration/
|
2065
|
-
def included(
|
2066
|
-
end
|
2067
|
-
end
|
2068
|
-
|
2069
|
-
# source://mocha//lib/mocha/integration/mini_test/version_230_to_2101.rb#21
|
2070
|
-
module Mocha::Integration::MiniTest::Version230To2101::RunMethodPatch
|
2071
|
-
# source://mocha//lib/mocha/integration/mini_test/version_230_to_2101.rb#23
|
2072
|
-
def run(runner); end
|
2073
|
-
end
|
2074
|
-
|
2075
|
-
# source://mocha//lib/mocha/integration/monkey_patcher.rb#5
|
2076
|
-
module Mocha::Integration::MonkeyPatcher
|
2077
|
-
class << self
|
2078
|
-
# source://mocha//lib/mocha/integration/monkey_patcher.rb#6
|
2079
|
-
def apply(mod, run_method_patch); end
|
1826
|
+
# source://mocha//lib/mocha/integration/minitest/adapter.rb#25
|
1827
|
+
def included(_mod); end
|
2080
1828
|
end
|
2081
1829
|
end
|
2082
1830
|
|
2083
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1831
|
+
# source://mocha//lib/mocha/invocation.rb#8
|
2084
1832
|
class Mocha::Invocation
|
2085
1833
|
# @return [Invocation] a new instance of Invocation
|
2086
1834
|
#
|
2087
|
-
# source://mocha//lib/mocha/invocation.rb#
|
2088
|
-
def initialize(mock, method_name,
|
1835
|
+
# source://mocha//lib/mocha/invocation.rb#11
|
1836
|
+
def initialize(mock, method_name, arguments = T.unsafe(nil), block = T.unsafe(nil)); end
|
2089
1837
|
|
2090
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1838
|
+
# source://mocha//lib/mocha/invocation.rb#41
|
2091
1839
|
def arguments; end
|
2092
1840
|
|
2093
1841
|
# Returns the value of attribute block.
|
2094
1842
|
#
|
2095
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1843
|
+
# source://mocha//lib/mocha/invocation.rb#9
|
2096
1844
|
def block; end
|
2097
1845
|
|
2098
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1846
|
+
# source://mocha//lib/mocha/invocation.rb#20
|
2099
1847
|
def call(yield_parameters = T.unsafe(nil), return_values = T.unsafe(nil)); end
|
2100
1848
|
|
2101
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1849
|
+
# source://mocha//lib/mocha/invocation.rb#45
|
2102
1850
|
def call_description; end
|
2103
1851
|
|
2104
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1852
|
+
# source://mocha//lib/mocha/invocation.rb#61
|
2105
1853
|
def full_description; end
|
2106
1854
|
|
2107
1855
|
# Returns the value of attribute method_name.
|
2108
1856
|
#
|
2109
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1857
|
+
# source://mocha//lib/mocha/invocation.rb#9
|
2110
1858
|
def method_name; end
|
2111
1859
|
|
2112
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1860
|
+
# source://mocha//lib/mocha/invocation.rb#33
|
2113
1861
|
def raised(exception); end
|
2114
1862
|
|
2115
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1863
|
+
# source://mocha//lib/mocha/invocation.rb#55
|
2116
1864
|
def result_description; end
|
2117
1865
|
|
2118
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1866
|
+
# source://mocha//lib/mocha/invocation.rb#29
|
2119
1867
|
def returned(value); end
|
2120
1868
|
|
2121
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1869
|
+
# source://mocha//lib/mocha/invocation.rb#51
|
2122
1870
|
def short_call_description; end
|
2123
1871
|
|
2124
|
-
# source://mocha//lib/mocha/invocation.rb#
|
1872
|
+
# source://mocha//lib/mocha/invocation.rb#37
|
2125
1873
|
def threw(tag, value); end
|
1874
|
+
|
1875
|
+
private
|
1876
|
+
|
1877
|
+
# source://mocha//lib/mocha/invocation.rb#67
|
1878
|
+
def argument_description; end
|
2126
1879
|
end
|
2127
1880
|
|
2128
1881
|
# source://mocha//lib/mocha/logger.rb#2
|
@@ -2220,17 +1973,17 @@ end
|
|
2220
1973
|
# object.expected_method # => 2
|
2221
1974
|
# object.expected_method # => raises exception of class Exception1
|
2222
1975
|
#
|
2223
|
-
# source://mocha//lib/mocha/mock.rb#
|
1976
|
+
# source://mocha//lib/mocha/mock.rb#75
|
2224
1977
|
class Mocha::Mock
|
2225
1978
|
# @private
|
2226
1979
|
# @return [Mock] a new instance of Mock
|
2227
1980
|
#
|
2228
|
-
# source://mocha//lib/mocha/mock.rb#
|
1981
|
+
# source://mocha//lib/mocha/mock.rb#275
|
2229
1982
|
def initialize(mockery, name = T.unsafe(nil), receiver = T.unsafe(nil)); end
|
2230
1983
|
|
2231
1984
|
# @private
|
2232
1985
|
#
|
2233
|
-
# source://mocha//lib/mocha/mock.rb#
|
1986
|
+
# source://mocha//lib/mocha/mock.rb#299
|
2234
1987
|
def __expectations__; end
|
2235
1988
|
|
2236
1989
|
# Adds an expectation that the specified method must be called exactly once with any parameters.
|
@@ -2250,7 +2003,7 @@ class Mocha::Mock
|
|
2250
2003
|
# object.expected_method # => error raised when expected method invoked second time
|
2251
2004
|
# @example Setup multiple expectations using +expected_methods_vs_return_values+.
|
2252
2005
|
# object = mock()
|
2253
|
-
# object.expects(:
|
2006
|
+
# object.expects(expected_method_one: :result_one, expected_method_two: :result_two)
|
2254
2007
|
#
|
2255
2008
|
# # is exactly equivalent to
|
2256
2009
|
#
|
@@ -2261,13 +2014,13 @@ class Mocha::Mock
|
|
2261
2014
|
# @overload expects
|
2262
2015
|
# @return [Expectation] last-built expectation which can be further modified by methods on {Expectation}.
|
2263
2016
|
#
|
2264
|
-
# source://mocha//lib/mocha/mock.rb#
|
2017
|
+
# source://mocha//lib/mocha/mock.rb#110
|
2265
2018
|
def __expects__(method_name_or_hash, backtrace = T.unsafe(nil)); end
|
2266
2019
|
|
2267
2020
|
# @private
|
2268
2021
|
#
|
2269
|
-
# source://mocha//lib/mocha/mock.rb#
|
2270
|
-
def __expire__; end
|
2022
|
+
# source://mocha//lib/mocha/mock.rb#346
|
2023
|
+
def __expire__(origin); end
|
2271
2024
|
|
2272
2025
|
def __singleton_class__; end
|
2273
2026
|
|
@@ -2281,7 +2034,7 @@ class Mocha::Mock
|
|
2281
2034
|
# # no error raised
|
2282
2035
|
# @example Setup multiple expectations using +stubbed_methods_vs_return_values+.
|
2283
2036
|
# object = mock()
|
2284
|
-
# object.stubs(:
|
2037
|
+
# object.stubs(stubbed_method_one: :result_one, stubbed_method_two: :result_two)
|
2285
2038
|
#
|
2286
2039
|
# # is exactly equivalent to
|
2287
2040
|
#
|
@@ -2298,28 +2051,28 @@ class Mocha::Mock
|
|
2298
2051
|
# @private
|
2299
2052
|
# @return [Boolean]
|
2300
2053
|
#
|
2301
|
-
# source://mocha//lib/mocha/mock.rb#
|
2054
|
+
# source://mocha//lib/mocha/mock.rb#341
|
2302
2055
|
def __verified__?(assertion_counter = T.unsafe(nil)); end
|
2303
2056
|
|
2304
2057
|
# @private
|
2305
2058
|
#
|
2306
|
-
# source://mocha//lib/mocha/mock.rb#
|
2059
|
+
# source://mocha//lib/mocha/mock.rb#309
|
2307
2060
|
def all_expectations; end
|
2308
2061
|
|
2309
2062
|
# @private
|
2310
2063
|
# @return [Boolean]
|
2311
2064
|
#
|
2312
|
-
# source://mocha//lib/mocha/mock.rb#
|
2065
|
+
# source://mocha//lib/mocha/mock.rb#366
|
2313
2066
|
def any_expectations?; end
|
2314
2067
|
|
2315
2068
|
# @private
|
2316
2069
|
#
|
2317
|
-
# source://mocha//lib/mocha/mock.rb#
|
2070
|
+
# source://mocha//lib/mocha/mock.rb#361
|
2318
2071
|
def ensure_method_not_already_defined(method_name); end
|
2319
2072
|
|
2320
2073
|
# @private
|
2321
2074
|
#
|
2322
|
-
# source://mocha//lib/mocha/mock.rb#
|
2075
|
+
# source://mocha//lib/mocha/mock.rb#287
|
2323
2076
|
def everything_stubbed; end
|
2324
2077
|
|
2325
2078
|
# Adds an expectation that the specified method must be called exactly once with any parameters.
|
@@ -2339,7 +2092,7 @@ class Mocha::Mock
|
|
2339
2092
|
# object.expected_method # => error raised when expected method invoked second time
|
2340
2093
|
# @example Setup multiple expectations using +expected_methods_vs_return_values+.
|
2341
2094
|
# object = mock()
|
2342
|
-
# object.expects(:
|
2095
|
+
# object.expects(expected_method_one: :result_one, expected_method_two: :result_two)
|
2343
2096
|
#
|
2344
2097
|
# # is exactly equivalent to
|
2345
2098
|
#
|
@@ -2350,29 +2103,34 @@ class Mocha::Mock
|
|
2350
2103
|
# @overload expects
|
2351
2104
|
# @return [Expectation] last-built expectation which can be further modified by methods on {Expectation}.
|
2352
2105
|
#
|
2353
|
-
# source://mocha//lib/mocha/mock.rb#
|
2106
|
+
# source://mocha//lib/mocha/mock.rb#110
|
2354
2107
|
def expects(method_name_or_hash, backtrace = T.unsafe(nil)); end
|
2355
2108
|
|
2356
2109
|
# @private
|
2357
2110
|
#
|
2358
|
-
# source://mocha//lib/mocha/mock.rb#
|
2111
|
+
# source://mocha//lib/mocha/mock.rb#320
|
2112
|
+
def handle_method_call(symbol, arguments, block); end
|
2113
|
+
|
2114
|
+
# @private
|
2115
|
+
#
|
2116
|
+
# source://mocha//lib/mocha/mock.rb#356
|
2359
2117
|
def inspect; end
|
2360
2118
|
|
2361
2119
|
# @private
|
2362
2120
|
#
|
2363
|
-
# source://mocha//lib/mocha/mock.rb#
|
2364
|
-
def method_missing(symbol, *arguments, &block); end
|
2121
|
+
# source://mocha//lib/mocha/mock.rb#314
|
2122
|
+
def method_missing(symbol, *arguments, **_arg2, &block); end
|
2365
2123
|
|
2366
2124
|
# @private
|
2367
2125
|
#
|
2368
|
-
# source://mocha//lib/mocha/mock.rb#
|
2126
|
+
# source://mocha//lib/mocha/mock.rb#351
|
2369
2127
|
def mocha_inspect; end
|
2370
2128
|
|
2371
|
-
# Constrains the {Mock} instance so that it can only expect or stub methods to which +responder+ responds. The constraint is only applied at method invocation time.
|
2129
|
+
# Constrains the {Mock} instance so that it can only expect or stub methods to which +responder+ responds publicly. The constraint is only applied at method invocation time.
|
2372
2130
|
#
|
2373
|
-
# A +NoMethodError+ will be raised if the +responder+ does not +#respond_to?+
|
2131
|
+
# A +NoMethodError+ will be raised if the +responder+ does not publicly +#respond_to?+ the invoked method (even if the method has been expected or stubbed).
|
2374
2132
|
#
|
2375
|
-
# The {Mock} instance will delegate its +#respond_to?+ method to the +responder+.
|
2133
|
+
# The {Mock} instance will delegate its +#respond_to?+ method to the +responder+. However, the +include_all+ parameter is not passed through, so only public methods on the +responder+ will be considered.
|
2376
2134
|
#
|
2377
2135
|
# Note that the methods on +responder+ are never actually invoked.
|
2378
2136
|
#
|
@@ -2415,14 +2173,14 @@ class Mocha::Mock
|
|
2415
2173
|
# @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
|
2416
2174
|
# @see #responds_like_instance_of
|
2417
2175
|
#
|
2418
|
-
# source://mocha//lib/mocha/mock.rb#
|
2176
|
+
# source://mocha//lib/mocha/mock.rb#237
|
2419
2177
|
def quacks_like(responder); end
|
2420
2178
|
|
2421
|
-
# Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+.
|
2179
|
+
# Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds publicly. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+.
|
2422
2180
|
#
|
2423
|
-
# A +NoMethodError+ will be raised if the responder instance does not +#respond_to?+
|
2181
|
+
# A +NoMethodError+ will be raised if the responder instance does not publicly +#respond_to?+ the invoked method (even if the method has been expected or stubbed).
|
2424
2182
|
#
|
2425
|
-
# The {Mock} instance will delegate its +#respond_to?+ method to the responder instance.
|
2183
|
+
# The {Mock} instance will delegate its +#respond_to?+ method to the responder instance. However, the +include_all+ parameter is not passed through, so only public methods on the +responder+ will be considered.
|
2426
2184
|
#
|
2427
2185
|
# Note that the methods on the responder instance are never actually invoked.
|
2428
2186
|
#
|
@@ -2446,14 +2204,14 @@ class Mocha::Mock
|
|
2446
2204
|
# @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
|
2447
2205
|
# @see #responds_like
|
2448
2206
|
#
|
2449
|
-
# source://mocha//lib/mocha/mock.rb#
|
2207
|
+
# source://mocha//lib/mocha/mock.rb#270
|
2450
2208
|
def quacks_like_instance_of(responder_class); end
|
2451
2209
|
|
2452
|
-
# Constrains the {Mock} instance so that it can only expect or stub methods to which +responder+ responds. The constraint is only applied at method invocation time.
|
2210
|
+
# Constrains the {Mock} instance so that it can only expect or stub methods to which +responder+ responds publicly. The constraint is only applied at method invocation time.
|
2453
2211
|
#
|
2454
|
-
# A +NoMethodError+ will be raised if the +responder+ does not +#respond_to?+
|
2212
|
+
# A +NoMethodError+ will be raised if the +responder+ does not publicly +#respond_to?+ the invoked method (even if the method has been expected or stubbed).
|
2455
2213
|
#
|
2456
|
-
# The {Mock} instance will delegate its +#respond_to?+ method to the +responder+.
|
2214
|
+
# The {Mock} instance will delegate its +#respond_to?+ method to the +responder+. However, the +include_all+ parameter is not passed through, so only public methods on the +responder+ will be considered.
|
2457
2215
|
#
|
2458
2216
|
# Note that the methods on +responder+ are never actually invoked.
|
2459
2217
|
#
|
@@ -2496,14 +2254,14 @@ class Mocha::Mock
|
|
2496
2254
|
# @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
|
2497
2255
|
# @see #responds_like_instance_of
|
2498
2256
|
#
|
2499
|
-
# source://mocha//lib/mocha/mock.rb#
|
2257
|
+
# source://mocha//lib/mocha/mock.rb#237
|
2500
2258
|
def responds_like(responder); end
|
2501
2259
|
|
2502
|
-
# Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+.
|
2260
|
+
# Constrains the {Mock} instance so that it can only expect or stub methods to which an instance of the +responder_class+ responds publicly. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using +Class#allocate+.
|
2503
2261
|
#
|
2504
|
-
# A +NoMethodError+ will be raised if the responder instance does not +#respond_to?+
|
2262
|
+
# A +NoMethodError+ will be raised if the responder instance does not publicly +#respond_to?+ the invoked method (even if the method has been expected or stubbed).
|
2505
2263
|
#
|
2506
|
-
# The {Mock} instance will delegate its +#respond_to?+ method to the responder instance.
|
2264
|
+
# The {Mock} instance will delegate its +#respond_to?+ method to the responder instance. However, the +include_all+ parameter is not passed through, so only public methods on the +responder+ will be considered.
|
2507
2265
|
#
|
2508
2266
|
# Note that the methods on the responder instance are never actually invoked.
|
2509
2267
|
#
|
@@ -2527,12 +2285,12 @@ class Mocha::Mock
|
|
2527
2285
|
# @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
|
2528
2286
|
# @see #responds_like
|
2529
2287
|
#
|
2530
|
-
# source://mocha//lib/mocha/mock.rb#
|
2288
|
+
# source://mocha//lib/mocha/mock.rb#270
|
2531
2289
|
def responds_like_instance_of(responder_class); end
|
2532
2290
|
|
2533
2291
|
# @private
|
2534
2292
|
#
|
2535
|
-
# source://mocha//lib/mocha/mock.rb#
|
2293
|
+
# source://mocha//lib/mocha/mock.rb#304
|
2536
2294
|
def stub_everything; end
|
2537
2295
|
|
2538
2296
|
# Adds an expectation that the specified method may be called any number of times with any parameters.
|
@@ -2545,7 +2303,7 @@ class Mocha::Mock
|
|
2545
2303
|
# # no error raised
|
2546
2304
|
# @example Setup multiple expectations using +stubbed_methods_vs_return_values+.
|
2547
2305
|
# object = mock()
|
2548
|
-
# object.stubs(:
|
2306
|
+
# object.stubs(stubbed_method_one: :result_one, stubbed_method_two: :result_two)
|
2549
2307
|
#
|
2550
2308
|
# # is exactly equivalent to
|
2551
2309
|
#
|
@@ -2562,7 +2320,7 @@ class Mocha::Mock
|
|
2562
2320
|
# Removes the specified stubbed methods (added by calls to {#expects} or {#stubs}) and all expectations associated with them.
|
2563
2321
|
#
|
2564
2322
|
# @example Invoking an unstubbed method causes error to be raised
|
2565
|
-
# object = mock('mock')
|
2323
|
+
# object = mock('mock')
|
2566
2324
|
# object.stubs(:stubbed_method).returns(:result_one)
|
2567
2325
|
# object.stubbed_method # => :result_one
|
2568
2326
|
# object.unstub(:stubbed_method)
|
@@ -2576,131 +2334,136 @@ class Mocha::Mock
|
|
2576
2334
|
# multiplier.unstub(:triple)
|
2577
2335
|
# @param method_names [Array<Symbol>] names of methods to unstub.
|
2578
2336
|
#
|
2579
|
-
# source://mocha//lib/mocha/mock.rb#
|
2337
|
+
# source://mocha//lib/mocha/mock.rb#182
|
2580
2338
|
def unstub(*method_names); end
|
2581
2339
|
|
2582
2340
|
private
|
2583
2341
|
|
2342
|
+
# @raise [StubbingError]
|
2343
|
+
#
|
2584
2344
|
# source://mocha//lib/mocha/mock.rb#393
|
2585
2345
|
def check_expiry; end
|
2586
2346
|
|
2587
2347
|
# source://mocha//lib/mocha/mock.rb#387
|
2588
2348
|
def check_responder_responds_to(symbol); end
|
2589
2349
|
|
2590
|
-
# source://mocha//lib/mocha/mock.rb#
|
2350
|
+
# source://mocha//lib/mocha/mock.rb#372
|
2591
2351
|
def raise_unexpected_invocation_error(invocation, matching_expectation); end
|
2592
2352
|
|
2593
2353
|
# @private
|
2594
2354
|
# @return [Boolean]
|
2595
2355
|
#
|
2596
|
-
# source://mocha//lib/mocha/mock.rb#
|
2597
|
-
def respond_to_missing?(symbol,
|
2356
|
+
# source://mocha//lib/mocha/mock.rb#332
|
2357
|
+
def respond_to_missing?(symbol, _include_all); end
|
2598
2358
|
end
|
2599
2359
|
|
2600
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2360
|
+
# source://mocha//lib/mocha/mockery.rb#13
|
2601
2361
|
class Mocha::Mockery
|
2602
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2362
|
+
# source://mocha//lib/mocha/mockery.rb#138
|
2603
2363
|
def logger; end
|
2604
2364
|
|
2605
2365
|
# Sets the attribute logger
|
2606
2366
|
#
|
2607
2367
|
# @param value the value to set the attribute logger to.
|
2608
2368
|
#
|
2609
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2369
|
+
# source://mocha//lib/mocha/mockery.rb#136
|
2610
2370
|
def logger=(_arg0); end
|
2611
2371
|
|
2612
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2372
|
+
# source://mocha//lib/mocha/mockery.rb#116
|
2613
2373
|
def mocha_inspect; end
|
2614
2374
|
|
2615
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2375
|
+
# source://mocha//lib/mocha/mockery.rb#66
|
2616
2376
|
def mock_impersonating(object); end
|
2617
2377
|
|
2618
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2378
|
+
# source://mocha//lib/mocha/mockery.rb#70
|
2619
2379
|
def mock_impersonating_any_instance_of(klass); end
|
2620
2380
|
|
2621
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2381
|
+
# source://mocha//lib/mocha/mockery.rb#104
|
2622
2382
|
def mocks; end
|
2623
2383
|
|
2624
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2384
|
+
# source://mocha//lib/mocha/mockery.rb#58
|
2625
2385
|
def named_mock(name); end
|
2626
2386
|
|
2627
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2387
|
+
# source://mocha//lib/mocha/mockery.rb#74
|
2628
2388
|
def new_state_machine(name); end
|
2629
2389
|
|
2630
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2390
|
+
# source://mocha//lib/mocha/mockery.rb#124
|
2631
2391
|
def on_stubbing(object, method); end
|
2632
2392
|
|
2633
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2393
|
+
# source://mocha//lib/mocha/mockery.rb#112
|
2394
|
+
def sequences; end
|
2395
|
+
|
2396
|
+
# source://mocha//lib/mocha/mockery.rb#108
|
2634
2397
|
def state_machines; end
|
2635
2398
|
|
2636
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2399
|
+
# source://mocha//lib/mocha/mockery.rb#100
|
2637
2400
|
def stubba; end
|
2638
2401
|
|
2639
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2640
|
-
def teardown; end
|
2402
|
+
# source://mocha//lib/mocha/mockery.rb#94
|
2403
|
+
def teardown(origin = T.unsafe(nil)); end
|
2641
2404
|
|
2642
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2405
|
+
# source://mocha//lib/mocha/mockery.rb#62
|
2643
2406
|
def unnamed_mock; end
|
2644
2407
|
|
2645
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2408
|
+
# source://mocha//lib/mocha/mockery.rb#78
|
2646
2409
|
def verify(assertion_counter = T.unsafe(nil)); end
|
2647
2410
|
|
2648
2411
|
private
|
2649
2412
|
|
2650
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2413
|
+
# source://mocha//lib/mocha/mockery.rb#165
|
2651
2414
|
def add_mock(mock); end
|
2652
2415
|
|
2653
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2416
|
+
# source://mocha//lib/mocha/mockery.rb#170
|
2654
2417
|
def add_state_machine(state_machine); end
|
2655
2418
|
|
2656
2419
|
# @raise [StubbingError]
|
2657
2420
|
#
|
2658
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2421
|
+
# source://mocha//lib/mocha/mockery.rb#144
|
2659
2422
|
def check(action, description, signature_proc, backtrace = T.unsafe(nil)); end
|
2660
2423
|
|
2661
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2424
|
+
# source://mocha//lib/mocha/mockery.rb#153
|
2662
2425
|
def expectations; end
|
2663
2426
|
|
2664
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2427
|
+
# source://mocha//lib/mocha/mockery.rb#175
|
2665
2428
|
def reset; end
|
2666
2429
|
|
2667
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2430
|
+
# source://mocha//lib/mocha/mockery.rb#161
|
2668
2431
|
def satisfied_expectations; end
|
2669
2432
|
|
2670
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2433
|
+
# source://mocha//lib/mocha/mockery.rb#157
|
2671
2434
|
def unsatisfied_expectations; end
|
2672
2435
|
|
2673
2436
|
class << self
|
2674
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2437
|
+
# source://mocha//lib/mocha/mockery.rb#36
|
2675
2438
|
def instance; end
|
2676
2439
|
|
2677
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2440
|
+
# source://mocha//lib/mocha/mockery.rb#40
|
2678
2441
|
def setup; end
|
2679
2442
|
|
2680
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2681
|
-
def teardown; end
|
2443
|
+
# source://mocha//lib/mocha/mockery.rb#51
|
2444
|
+
def teardown(origin = T.unsafe(nil)); end
|
2682
2445
|
|
2683
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2446
|
+
# source://mocha//lib/mocha/mockery.rb#47
|
2684
2447
|
def verify(*args); end
|
2685
2448
|
end
|
2686
2449
|
end
|
2687
2450
|
|
2688
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2451
|
+
# source://mocha//lib/mocha/mockery.rb#14
|
2689
2452
|
class Mocha::Mockery::Null < ::Mocha::Mockery
|
2690
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2453
|
+
# source://mocha//lib/mocha/mockery.rb#15
|
2691
2454
|
def add_mock(*_arg0); end
|
2692
2455
|
|
2693
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2456
|
+
# source://mocha//lib/mocha/mockery.rb#19
|
2694
2457
|
def add_state_machine(*_arg0); end
|
2695
2458
|
|
2696
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2459
|
+
# source://mocha//lib/mocha/mockery.rb#23
|
2697
2460
|
def stubba; end
|
2698
2461
|
|
2699
2462
|
private
|
2700
2463
|
|
2701
2464
|
# @raise [NotInitializedError]
|
2702
2465
|
#
|
2703
|
-
# source://mocha//lib/mocha/mockery.rb#
|
2466
|
+
# source://mocha//lib/mocha/mockery.rb#29
|
2704
2467
|
def raise_not_initialized_error; end
|
2705
2468
|
end
|
2706
2469
|
|
@@ -2740,7 +2503,7 @@ module Mocha::ObjectMethods
|
|
2740
2503
|
# assert_equal true, product.save
|
2741
2504
|
# @example Setting up multiple expectations on a non-mock object.
|
2742
2505
|
# product = Product.new
|
2743
|
-
# product.expects(
|
2506
|
+
# product.expects(valid?: true, save: true)
|
2744
2507
|
#
|
2745
2508
|
# # exactly equivalent to
|
2746
2509
|
#
|
@@ -2791,7 +2554,7 @@ module Mocha::ObjectMethods
|
|
2791
2554
|
# assert_equal true, product.save
|
2792
2555
|
# @example Setting up multiple stubbed methods on a non-mock object.
|
2793
2556
|
# product = Product.new
|
2794
|
-
# product.stubs(
|
2557
|
+
# product.stubs(valid?: true, save: true)
|
2795
2558
|
#
|
2796
2559
|
# # exactly equivalent to
|
2797
2560
|
#
|
@@ -2844,9 +2607,6 @@ class Mocha::ObjectReceiver
|
|
2844
2607
|
def mocks; end
|
2845
2608
|
end
|
2846
2609
|
|
2847
|
-
# source://mocha//lib/mocha/ruby_version.rb#2
|
2848
|
-
Mocha::PRE_RUBY_V19 = T.let(T.unsafe(nil), FalseClass)
|
2849
|
-
|
2850
2610
|
# Used as parameters for {Expectation#with} to restrict the parameter values which will match the expectation. Can be nested.
|
2851
2611
|
#
|
2852
2612
|
# source://mocha//lib/mocha/parameter_matchers.rb#3
|
@@ -2982,7 +2742,7 @@ module Mocha::ParameterMatchers
|
|
2982
2742
|
# @return [EquivalentUri] parameter matcher.
|
2983
2743
|
# @see Expectation#with
|
2984
2744
|
#
|
2985
|
-
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#
|
2745
|
+
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#25
|
2986
2746
|
def equivalent_uri(uri); end
|
2987
2747
|
|
2988
2748
|
# Matches +Hash+ containing all +entries+.
|
@@ -3106,7 +2866,7 @@ module Mocha::ParameterMatchers
|
|
3106
2866
|
# @example Actual parameter includes item which matches nested matcher.
|
3107
2867
|
# object = mock()
|
3108
2868
|
# object.expects(:method_1).with(includes(has_key(:key)))
|
3109
|
-
# object.method_1(['foo', 'bar', {:
|
2869
|
+
# object.method_1(['foo', 'bar', {key: 'baz'}])
|
3110
2870
|
# # no error raised
|
3111
2871
|
# @example Actual parameter does not include item matching nested matcher.
|
3112
2872
|
# object.method_1(['foo', 'bar', {:other_key => 'baz'}])
|
@@ -3122,10 +2882,10 @@ module Mocha::ParameterMatchers
|
|
3122
2882
|
# @example Actual parameter is a Hash including the given key.
|
3123
2883
|
# object = mock()
|
3124
2884
|
# object.expects(:method_1).with(includes(:bar))
|
3125
|
-
# object.method_1({:
|
2885
|
+
# object.method_1({foo: 1, bar: 2})
|
3126
2886
|
# # no error raised
|
3127
2887
|
# @example Actual parameter is a Hash without the given key.
|
3128
|
-
# object.method_1({:
|
2888
|
+
# object.method_1({foo: 1, baz: 2})
|
3129
2889
|
# # error raised, because hash does not include key 'bar'
|
3130
2890
|
# @example Actual parameter is a Hash with a key matching the given matcher.
|
3131
2891
|
# object = mock()
|
@@ -3251,8 +3011,6 @@ module Mocha::ParameterMatchers
|
|
3251
3011
|
# source://mocha//lib/mocha/parameter_matchers/regexp_matches.rb#24
|
3252
3012
|
def regexp_matches(regexp); end
|
3253
3013
|
|
3254
|
-
# Matches any object that responds to +message+ with +result+. To put it another way, it tests the quack, not the duck.
|
3255
|
-
#
|
3256
3014
|
# @example Actual parameter responds with "FOO" when :upcase is invoked.
|
3257
3015
|
# object = mock()
|
3258
3016
|
# object.expects(:method_1).with(responds_with(:upcase, "FOO"))
|
@@ -3263,13 +3021,18 @@ module Mocha::ParameterMatchers
|
|
3263
3021
|
# object.expects(:method_1).with(responds_with(:upcase, "BAR"))
|
3264
3022
|
# object.method_1("foo")
|
3265
3023
|
# # error raised, because "foo".upcase != "BAR"
|
3266
|
-
# @
|
3267
|
-
#
|
3024
|
+
# @example Actual parameter responds with "FOO" when :upcase is invoked and "oof" when :reverse is invoked.
|
3025
|
+
# object = mock()
|
3026
|
+
# object.expects(:method_1).with(responds_with(upcase: "FOO", reverse: "oof"))
|
3027
|
+
# object.method_1("foo")
|
3028
|
+
# # no error raised, because "foo".upcase == "FOO" and "foo".reverse == "oof"
|
3029
|
+
# @overload responds_with
|
3030
|
+
# @overload responds_with
|
3268
3031
|
# @return [RespondsWith] parameter matcher.
|
3269
3032
|
# @see Expectation#with
|
3270
3033
|
#
|
3271
|
-
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#
|
3272
|
-
def responds_with(
|
3034
|
+
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#37
|
3035
|
+
def responds_with(*options); end
|
3273
3036
|
|
3274
3037
|
# Matches any YAML that represents the specified +object+
|
3275
3038
|
#
|
@@ -3387,24 +3150,19 @@ class Mocha::ParameterMatchers::Base
|
|
3387
3150
|
# @example Alternative ways to combine matchers with a logical AND.
|
3388
3151
|
# object = mock()
|
3389
3152
|
# object.expects(:run).with(all_of(has_key(:foo), has_key(:bar)))
|
3390
|
-
# object.run(:
|
3153
|
+
# object.run(foo: 'foovalue', bar: 'barvalue')
|
3391
3154
|
#
|
3392
3155
|
# # is exactly equivalent to
|
3393
3156
|
#
|
3394
3157
|
# object.expects(:run).with(has_key(:foo) & has_key(:bar))
|
3395
|
-
# object.run(:
|
3158
|
+
# object.run(foo: 'foovalue', bar: 'barvalue)
|
3396
3159
|
# @param other [Base] parameter matcher.
|
3397
3160
|
# @return [AllOf] parameter matcher.
|
3398
3161
|
# @see Expectation#with
|
3399
3162
|
#
|
3400
|
-
# source://mocha//lib/mocha/parameter_matchers/base.rb#
|
3163
|
+
# source://mocha//lib/mocha/parameter_matchers/base.rb#25
|
3401
3164
|
def &(other); end
|
3402
3165
|
|
3403
|
-
# @private
|
3404
|
-
#
|
3405
|
-
# source://mocha//lib/mocha/parameter_matchers/base.rb#6
|
3406
|
-
def to_matcher; end
|
3407
|
-
|
3408
3166
|
# A shorthand way of combining two matchers when at least one must match.
|
3409
3167
|
#
|
3410
3168
|
# Returns a new +AnyOf+ parameter matcher combining two matchers using a logical OR.
|
@@ -3414,12 +3172,12 @@ class Mocha::ParameterMatchers::Base
|
|
3414
3172
|
# @example Alternative ways to combine matchers with a logical OR.
|
3415
3173
|
# object = mock()
|
3416
3174
|
# object.expects(:run).with(any_of(has_key(:foo), has_key(:bar)))
|
3417
|
-
# object.run(:
|
3175
|
+
# object.run(foo: 'foovalue')
|
3418
3176
|
#
|
3419
3177
|
# # is exactly equivalent to
|
3420
3178
|
#
|
3421
3179
|
# object.expects(:run).with(has_key(:foo) | has_key(:bar))
|
3422
|
-
# object.run(:
|
3180
|
+
# object.run(foo: 'foovalue')
|
3423
3181
|
# @example Using an explicit {Equals} matcher in combination with {#|}.
|
3424
3182
|
# object.expects(:run).with(equals(1) | equals(2))
|
3425
3183
|
# object.run(1) # passes
|
@@ -3429,7 +3187,7 @@ class Mocha::ParameterMatchers::Base
|
|
3429
3187
|
# @return [AnyOf] parameter matcher.
|
3430
3188
|
# @see Expectation#with
|
3431
3189
|
#
|
3432
|
-
# source://mocha//lib/mocha/parameter_matchers/base.rb#
|
3190
|
+
# source://mocha//lib/mocha/parameter_matchers/base.rb#55
|
3433
3191
|
def |(other); end
|
3434
3192
|
end
|
3435
3193
|
|
@@ -3457,30 +3215,30 @@ end
|
|
3457
3215
|
|
3458
3216
|
# Parameter matcher which matches URIs with equivalent query strings.
|
3459
3217
|
#
|
3460
|
-
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#
|
3218
|
+
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#30
|
3461
3219
|
class Mocha::ParameterMatchers::EquivalentUri < ::Mocha::ParameterMatchers::Base
|
3462
3220
|
# @private
|
3463
3221
|
# @return [EquivalentUri] a new instance of EquivalentUri
|
3464
3222
|
#
|
3465
|
-
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#
|
3223
|
+
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#32
|
3466
3224
|
def initialize(uri); end
|
3467
3225
|
|
3468
3226
|
# @private
|
3469
3227
|
# @return [Boolean]
|
3470
3228
|
#
|
3471
|
-
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#
|
3229
|
+
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#37
|
3472
3230
|
def matches?(available_parameters); end
|
3473
3231
|
|
3474
3232
|
# @private
|
3475
3233
|
#
|
3476
|
-
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#
|
3234
|
+
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#44
|
3477
3235
|
def mocha_inspect; end
|
3478
3236
|
|
3479
3237
|
private
|
3480
3238
|
|
3481
3239
|
# @private
|
3482
3240
|
#
|
3483
|
-
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#
|
3241
|
+
# source://mocha//lib/mocha/parameter_matchers/equivalent_uri.rb#51
|
3484
3242
|
def explode(uri); end
|
3485
3243
|
end
|
3486
3244
|
|
@@ -3492,17 +3250,17 @@ class Mocha::ParameterMatchers::HasEntries < ::Mocha::ParameterMatchers::Base
|
|
3492
3250
|
# @return [HasEntries] a new instance of HasEntries
|
3493
3251
|
#
|
3494
3252
|
# source://mocha//lib/mocha/parameter_matchers/has_entries.rb#33
|
3495
|
-
def initialize(entries); end
|
3253
|
+
def initialize(entries, exact: T.unsafe(nil)); end
|
3496
3254
|
|
3497
3255
|
# @private
|
3498
3256
|
# @return [Boolean]
|
3499
3257
|
#
|
3500
|
-
# source://mocha//lib/mocha/parameter_matchers/has_entries.rb#
|
3258
|
+
# source://mocha//lib/mocha/parameter_matchers/has_entries.rb#39
|
3501
3259
|
def matches?(available_parameters); end
|
3502
3260
|
|
3503
3261
|
# @private
|
3504
3262
|
#
|
3505
|
-
# source://mocha//lib/mocha/parameter_matchers/has_entries.rb#
|
3263
|
+
# source://mocha//lib/mocha/parameter_matchers/has_entries.rb#50
|
3506
3264
|
def mocha_inspect; end
|
3507
3265
|
end
|
3508
3266
|
|
@@ -3619,12 +3377,12 @@ end
|
|
3619
3377
|
|
3620
3378
|
# @private
|
3621
3379
|
#
|
3622
|
-
# source://mocha//lib/mocha/parameter_matchers/instance_methods.rb#
|
3380
|
+
# source://mocha//lib/mocha/parameter_matchers/instance_methods.rb#8
|
3623
3381
|
module Mocha::ParameterMatchers::InstanceMethods
|
3624
3382
|
# @private
|
3625
3383
|
#
|
3626
|
-
# source://mocha//lib/mocha/parameter_matchers/instance_methods.rb#
|
3627
|
-
def to_matcher; end
|
3384
|
+
# source://mocha//lib/mocha/parameter_matchers/instance_methods.rb#10
|
3385
|
+
def to_matcher(expectation: T.unsafe(nil), top_level: T.unsafe(nil)); end
|
3628
3386
|
end
|
3629
3387
|
|
3630
3388
|
# Parameter matcher which matches when actual parameter is an instance of the specified class.
|
@@ -3737,6 +3495,48 @@ class Mocha::ParameterMatchers::Optionally < ::Mocha::ParameterMatchers::Base
|
|
3737
3495
|
def mocha_inspect; end
|
3738
3496
|
end
|
3739
3497
|
|
3498
|
+
# @private
|
3499
|
+
#
|
3500
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#9
|
3501
|
+
class Mocha::ParameterMatchers::PositionalOrKeywordHash < ::Mocha::ParameterMatchers::Base
|
3502
|
+
# @return [PositionalOrKeywordHash] a new instance of PositionalOrKeywordHash
|
3503
|
+
#
|
3504
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#10
|
3505
|
+
def initialize(value, expectation); end
|
3506
|
+
|
3507
|
+
# @return [Boolean]
|
3508
|
+
#
|
3509
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#15
|
3510
|
+
def matches?(available_parameters); end
|
3511
|
+
|
3512
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#29
|
3513
|
+
def mocha_inspect; end
|
3514
|
+
|
3515
|
+
private
|
3516
|
+
|
3517
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#43
|
3518
|
+
def deprecation_warning(actual, expected); end
|
3519
|
+
|
3520
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#59
|
3521
|
+
def expectation_definition; end
|
3522
|
+
|
3523
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#35
|
3524
|
+
def extract_parameter(available_parameters); end
|
3525
|
+
|
3526
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#51
|
3527
|
+
def hash_type(hash); end
|
3528
|
+
|
3529
|
+
# @return [Boolean]
|
3530
|
+
#
|
3531
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#55
|
3532
|
+
def ruby2_keywords_hash?(hash); end
|
3533
|
+
|
3534
|
+
# @return [Boolean]
|
3535
|
+
#
|
3536
|
+
# source://mocha//lib/mocha/parameter_matchers/positional_or_keyword_hash.rb#39
|
3537
|
+
def same_type_of_hash?(actual, expected); end
|
3538
|
+
end
|
3539
|
+
|
3740
3540
|
# Parameter matcher which matches if specified regular expression matches actual paramter.
|
3741
3541
|
#
|
3742
3542
|
# source://mocha//lib/mocha/parameter_matchers/regexp_matches.rb#29
|
@@ -3761,23 +3561,23 @@ end
|
|
3761
3561
|
|
3762
3562
|
# Parameter matcher which matches if actual parameter returns expected result when specified method is invoked.
|
3763
3563
|
#
|
3764
|
-
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#
|
3564
|
+
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#57
|
3765
3565
|
class Mocha::ParameterMatchers::RespondsWith < ::Mocha::ParameterMatchers::Base
|
3766
3566
|
# @private
|
3767
3567
|
# @return [RespondsWith] a new instance of RespondsWith
|
3768
3568
|
#
|
3769
|
-
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#
|
3569
|
+
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#59
|
3770
3570
|
def initialize(message, result); end
|
3771
3571
|
|
3772
3572
|
# @private
|
3773
3573
|
# @return [Boolean]
|
3774
3574
|
#
|
3775
|
-
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#
|
3575
|
+
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#65
|
3776
3576
|
def matches?(available_parameters); end
|
3777
3577
|
|
3778
3578
|
# @private
|
3779
3579
|
#
|
3780
|
-
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#
|
3580
|
+
# source://mocha//lib/mocha/parameter_matchers/responds_with.rb#71
|
3781
3581
|
def mocha_inspect; end
|
3782
3582
|
end
|
3783
3583
|
|
@@ -3808,27 +3608,30 @@ class Mocha::ParametersMatcher
|
|
3808
3608
|
# @return [ParametersMatcher] a new instance of ParametersMatcher
|
3809
3609
|
#
|
3810
3610
|
# source://mocha//lib/mocha/parameters_matcher.rb#6
|
3811
|
-
def initialize(expected_parameters = T.unsafe(nil), &matching_block); end
|
3611
|
+
def initialize(expected_parameters = T.unsafe(nil), expectation = T.unsafe(nil), &matching_block); end
|
3812
3612
|
|
3813
3613
|
# @return [Boolean]
|
3814
3614
|
#
|
3815
|
-
# source://mocha//lib/mocha/parameters_matcher.rb#
|
3615
|
+
# source://mocha//lib/mocha/parameters_matcher.rb#12
|
3816
3616
|
def match?(actual_parameters = T.unsafe(nil)); end
|
3817
3617
|
|
3818
3618
|
# source://mocha//lib/mocha/parameters_matcher.rb#30
|
3819
3619
|
def matchers; end
|
3820
3620
|
|
3821
|
-
# source://mocha//lib/mocha/parameters_matcher.rb#
|
3621
|
+
# source://mocha//lib/mocha/parameters_matcher.rb#24
|
3822
3622
|
def mocha_inspect; end
|
3823
3623
|
|
3824
3624
|
# @return [Boolean]
|
3825
3625
|
#
|
3826
|
-
# source://mocha//lib/mocha/parameters_matcher.rb#
|
3626
|
+
# source://mocha//lib/mocha/parameters_matcher.rb#20
|
3827
3627
|
def parameters_match?(actual_parameters); end
|
3828
3628
|
end
|
3829
3629
|
|
3630
|
+
# source://mocha//lib/mocha/ruby_version.rb#2
|
3631
|
+
Mocha::RUBY_V27_PLUS = T.let(T.unsafe(nil), TrueClass)
|
3632
|
+
|
3830
3633
|
# source://mocha//lib/mocha/ruby_version.rb#3
|
3831
|
-
Mocha::
|
3634
|
+
Mocha::RUBY_V34_PLUS = T.let(T.unsafe(nil), FalseClass)
|
3832
3635
|
|
3833
3636
|
# source://mocha//lib/mocha/raised_exception.rb#2
|
3834
3637
|
class Mocha::RaisedException
|
@@ -4037,15 +3840,15 @@ class Mocha::StubbedMethod
|
|
4037
3840
|
|
4038
3841
|
def ==(_arg0); end
|
4039
3842
|
|
4040
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3843
|
+
# source://mocha//lib/mocha/stubbed_method.rb#43
|
4041
3844
|
def define_new_method; end
|
4042
3845
|
|
4043
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3846
|
+
# source://mocha//lib/mocha/stubbed_method.rb#37
|
4044
3847
|
def hide_original_method; end
|
4045
3848
|
|
4046
3849
|
# @return [Boolean]
|
4047
3850
|
#
|
4048
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3851
|
+
# source://mocha//lib/mocha/stubbed_method.rb#57
|
4049
3852
|
def matches?(other); end
|
4050
3853
|
|
4051
3854
|
# Returns the value of attribute method_name.
|
@@ -4053,21 +3856,15 @@ class Mocha::StubbedMethod
|
|
4053
3856
|
# source://mocha//lib/mocha/stubbed_method.rb#8
|
4054
3857
|
def method_name; end
|
4055
3858
|
|
4056
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3859
|
+
# source://mocha//lib/mocha/stubbed_method.rb#29
|
4057
3860
|
def mock; end
|
4058
3861
|
|
4059
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3862
|
+
# source://mocha//lib/mocha/stubbed_method.rb#53
|
4060
3863
|
def remove_new_method; end
|
4061
3864
|
|
4062
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3865
|
+
# source://mocha//lib/mocha/stubbed_method.rb#33
|
4063
3866
|
def reset_mocha; end
|
4064
3867
|
|
4065
|
-
# source://mocha//lib/mocha/stubbed_method.rb#74
|
4066
|
-
def restore_original_method; end
|
4067
|
-
|
4068
|
-
# source://mocha//lib/mocha/stubbed_method.rb#70
|
4069
|
-
def store_original_method; end
|
4070
|
-
|
4071
3868
|
# source://mocha//lib/mocha/stubbed_method.rb#17
|
4072
3869
|
def stub; end
|
4073
3870
|
|
@@ -4076,7 +3873,7 @@ class Mocha::StubbedMethod
|
|
4076
3873
|
# source://mocha//lib/mocha/stubbed_method.rb#8
|
4077
3874
|
def stubbee; end
|
4078
3875
|
|
4079
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3876
|
+
# source://mocha//lib/mocha/stubbed_method.rb#64
|
4080
3877
|
def to_s; end
|
4081
3878
|
|
4082
3879
|
# source://mocha//lib/mocha/stubbed_method.rb#22
|
@@ -4084,30 +3881,17 @@ class Mocha::StubbedMethod
|
|
4084
3881
|
|
4085
3882
|
private
|
4086
3883
|
|
4087
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
4088
|
-
def remove_original_method_from_stubbee; end
|
4089
|
-
|
4090
|
-
# source://mocha//lib/mocha/stubbed_method.rb#95
|
3884
|
+
# source://mocha//lib/mocha/stubbed_method.rb#70
|
4091
3885
|
def retain_original_visibility(method_owner); end
|
4092
3886
|
|
4093
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3887
|
+
# source://mocha//lib/mocha/stubbed_method.rb#75
|
4094
3888
|
def store_original_method_visibility; end
|
4095
3889
|
|
4096
|
-
#
|
4097
|
-
#
|
4098
|
-
# source://mocha//lib/mocha/stubbed_method.rb#104
|
4099
|
-
def stub_method_overwrites_original_method?; end
|
4100
|
-
|
4101
|
-
# source://mocha//lib/mocha/stubbed_method.rb#121
|
3890
|
+
# source://mocha//lib/mocha/stubbed_method.rb#84
|
4102
3891
|
def stub_method_owner; end
|
4103
3892
|
|
4104
|
-
# source://mocha//lib/mocha/stubbed_method.rb#
|
3893
|
+
# source://mocha//lib/mocha/stubbed_method.rb#79
|
4105
3894
|
def use_prepended_module_for_stub_method; end
|
4106
|
-
|
4107
|
-
# @return [Boolean]
|
4108
|
-
#
|
4109
|
-
# source://mocha//lib/mocha/stubbed_method.rb#112
|
4110
|
-
def use_prepended_module_for_stub_method?; end
|
4111
3895
|
end
|
4112
3896
|
|
4113
3897
|
# source://mocha//lib/mocha/stubbed_method.rb#6
|
@@ -4161,7 +3945,7 @@ end
|
|
4161
3945
|
|
4162
3946
|
# @private
|
4163
3947
|
#
|
4164
|
-
# source://mocha//lib/mocha/parameter_matchers/instance_methods.rb#
|
3948
|
+
# source://mocha//lib/mocha/parameter_matchers/instance_methods.rb#24
|
4165
3949
|
class Object < ::BasicObject
|
4166
3950
|
include ::Kernel
|
4167
3951
|
include ::PP::ObjectMixin
|
@@ -4170,7 +3954,7 @@ class Object < ::BasicObject
|
|
4170
3954
|
include ::Mocha::ObjectMethods
|
4171
3955
|
end
|
4172
3956
|
|
4173
|
-
# source://mocha//lib/mocha/inspect.rb#
|
3957
|
+
# source://mocha//lib/mocha/inspect.rb#64
|
4174
3958
|
class Time
|
4175
3959
|
include ::Comparable
|
4176
3960
|
include ::Mocha::Inspect::TimeMethods
|