lunchmoney 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,7 +37,7 @@ class Minitest::Test < ::Minitest::Runnable
37
37
  include ::Mocha::ParameterMatchers
38
38
  include ::Mocha::Hooks
39
39
  include ::Mocha::API
40
- include ::Mocha::Integration::MiniTest::Adapter
40
+ include ::Mocha::Integration::Minitest::Adapter
41
41
  end
42
42
 
43
43
  # source://mocha//lib/mocha/version.rb#1
@@ -66,7 +66,7 @@ module Mocha
66
66
  end
67
67
  end
68
68
 
69
- # Methods added to +Test::Unit::TestCase+, +MiniTest::Unit::TestCase+ or equivalent.
69
+ # Methods added to +Test::Unit::TestCase+, +Minitest::Unit::TestCase+ or equivalent.
70
70
  # The mock creation methods are {#mock}, {#stub} and {#stub_everything}, all of which return a #{Mock}
71
71
  # which can be further modified by {Mock#responds_like} and {Mock#responds_like_instance_of} methods,
72
72
  # both of which return a {Mock}, too, and can therefore, be chained to the original creation methods.
@@ -100,7 +100,7 @@ module Mocha::API
100
100
  #
101
101
  # @example Using expected_methods_vs_return_values Hash to setup expectations.
102
102
  # def test_motor_starts_and_stops
103
- # motor = mock('motor', :start => true, :stop => true)
103
+ # motor = mock('motor', start: true, stop: true)
104
104
  # assert motor.start
105
105
  # assert motor.stop
106
106
  # # an error will be raised unless both Motor#start and Motor#stop have been called
@@ -115,7 +115,8 @@ module Mocha::API
115
115
 
116
116
  # Builds a new sequence which can be used to constrain the order in which expectations can occur.
117
117
  #
118
- # Specify that an expected invocation must occur within a named {Sequence} by using {Expectation#in_sequence}.
118
+ # Specify that an expected invocation must occur within a named {Sequence} by calling {Expectation#in_sequence}
119
+ # on each expectation or by passing a block within which all expectations should be constrained by the {Sequence}.
119
120
  #
120
121
  # @example Ensure methods on egg are invoked in correct order.
121
122
  # breakfast = sequence('breakfast')
@@ -135,10 +136,19 @@ module Mocha::API
135
136
  #
136
137
  # task_one.execute
137
138
  # task_two.execute
139
+ # @example Ensure methods on egg are invoked in the correct order using a block.
140
+ # egg = mock('egg')
141
+ # sequence('breakfast') do
142
+ # egg.expects(:crack)
143
+ # egg.expects(:fry)
144
+ # egg.expects(:eat)
145
+ # end
146
+ # @param name [String] name of sequence
138
147
  # @return [Sequence] a new sequence
139
148
  # @see Expectation#in_sequence
149
+ # @yield optional block within which expectations should be constrained by the sequence
140
150
  #
141
- # source://mocha//lib/mocha/api.rb#159
151
+ # source://mocha//lib/mocha/api.rb#170
142
152
  def sequence(name); end
143
153
 
144
154
  # Builds a new state machine which can be used to constrain the order in which expectations can occur.
@@ -161,19 +171,20 @@ module Mocha::API
161
171
  # radio.expects(:select_channel).with('BBC World Service').when(power.is('on'))
162
172
  # radio.expects(:adjust_volume).with(-5).when(power.is('on'))
163
173
  # radio.expects(:switch_off).then(power.is('off'))
174
+ # @param name [String] name of state machine
164
175
  # @return [StateMachine] a new state machine
165
176
  # @see Expectation#then
166
177
  # @see Expectation#when
167
178
  # @see StateMachine
168
179
  #
169
- # source://mocha//lib/mocha/api.rb#188
180
+ # source://mocha//lib/mocha/api.rb#207
170
181
  def states(name); end
171
182
 
172
183
  # Builds a new mock object
173
184
  #
174
185
  # @example Using stubbed_methods_vs_return_values Hash to setup stubbed methods.
175
186
  # def test_motor_starts_and_stops
176
- # motor = stub('motor', :start => true, :stop => true)
187
+ # motor = stub('motor', start: true, stop: true)
177
188
  # assert motor.start
178
189
  # assert motor.stop
179
190
  # # an error will not be raised even if either Motor#start or Motor#stop has not been called
@@ -190,7 +201,7 @@ module Mocha::API
190
201
  #
191
202
  # @example Ignore invocations of irrelevant methods.
192
203
  # def test_motor_stops
193
- # motor = stub_everything('motor', :stop => true)
204
+ # motor = stub_everything('motor', stop: true)
194
205
  # assert_nil motor.irrelevant_method_1 # => no error raised
195
206
  # assert_nil motor.irrelevant_method_2 # => no error raised
196
207
  # assert motor.stop
@@ -873,16 +884,16 @@ class Mocha::Deprecation
873
884
  end
874
885
  end
875
886
 
876
- # source://mocha//lib/mocha/detection/mini_test.rb#2
887
+ # source://mocha//lib/mocha/detection/minitest.rb#2
877
888
  module Mocha::Detection; end
878
889
 
879
- # source://mocha//lib/mocha/detection/mini_test.rb#3
880
- module Mocha::Detection::MiniTest
890
+ # source://mocha//lib/mocha/detection/minitest.rb#3
891
+ module Mocha::Detection::Minitest
881
892
  class << self
882
- # source://mocha//lib/mocha/detection/mini_test.rb#4
893
+ # source://mocha//lib/mocha/detection/minitest.rb#4
883
894
  def testcase; end
884
895
 
885
- # source://mocha//lib/mocha/detection/mini_test.rb#12
896
+ # source://mocha//lib/mocha/detection/minitest.rb#12
886
897
  def version; end
887
898
  end
888
899
  end
@@ -1010,7 +1021,7 @@ class Mocha::Expectation
1010
1021
 
1011
1022
  # @private
1012
1023
  #
1013
- # source://mocha//lib/mocha/expectation.rb#698
1024
+ # source://mocha//lib/mocha/expectation.rb#704
1014
1025
  def definition_location; end
1015
1026
 
1016
1027
  # @private
@@ -1046,40 +1057,40 @@ class Mocha::Expectation
1046
1057
 
1047
1058
  # @private
1048
1059
  #
1049
- # source://mocha//lib/mocha/expectation.rb#674
1060
+ # source://mocha//lib/mocha/expectation.rb#680
1050
1061
  def inspect; end
1051
1062
 
1052
1063
  # @private
1053
1064
  # @return [Boolean]
1054
1065
  #
1055
- # source://mocha//lib/mocha/expectation.rb#646
1066
+ # source://mocha//lib/mocha/expectation.rb#652
1056
1067
  def invocations_allowed?; end
1057
1068
 
1058
1069
  # @private
1059
1070
  #
1060
- # source://mocha//lib/mocha/expectation.rb#656
1071
+ # source://mocha//lib/mocha/expectation.rb#662
1061
1072
  def invoke(invocation); end
1062
1073
 
1063
1074
  # @private
1064
1075
  # @return [Boolean]
1065
1076
  #
1066
- # source://mocha//lib/mocha/expectation.rb#641
1067
- def match?(invocation); end
1077
+ # source://mocha//lib/mocha/expectation.rb#646
1078
+ def match?(invocation, ignoring_order: T.unsafe(nil)); end
1068
1079
 
1069
1080
  # @private
1070
1081
  # @return [Boolean]
1071
1082
  #
1072
- # source://mocha//lib/mocha/expectation.rb#636
1083
+ # source://mocha//lib/mocha/expectation.rb#641
1073
1084
  def matches_method?(method_name); end
1074
1085
 
1075
1086
  # @private
1076
1087
  #
1077
- # source://mocha//lib/mocha/expectation.rb#691
1088
+ # source://mocha//lib/mocha/expectation.rb#697
1078
1089
  def method_signature; end
1079
1090
 
1080
1091
  # @private
1081
1092
  #
1082
- # source://mocha//lib/mocha/expectation.rb#681
1093
+ # source://mocha//lib/mocha/expectation.rb#687
1083
1094
  def mocha_inspect; end
1084
1095
 
1085
1096
  # Modifies expectation so that when the expected method is called, it yields multiple times per invocation with the specified +parameter_groups+.
@@ -1146,6 +1157,11 @@ class Mocha::Expectation
1146
1157
  # source://mocha//lib/mocha/expectation.rb#97
1147
1158
  def once; end
1148
1159
 
1160
+ # @private
1161
+ #
1162
+ # source://mocha//lib/mocha/expectation.rb#636
1163
+ def ordering_constraints_not_allowing_invocation_now; end
1164
+
1149
1165
  # @private
1150
1166
  #
1151
1167
  # source://mocha//lib/mocha/expectation.rb#626
@@ -1153,6 +1169,10 @@ class Mocha::Expectation
1153
1169
 
1154
1170
  # 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)+.
1155
1171
  #
1172
+ # @example Raise specified exception if expected method is invoked.
1173
+ # object = stub()
1174
+ # object.stubs(:expected_method).raises(Exception, 'message')
1175
+ # object.expected_method # => raises exception of class Exception and with message 'message'
1156
1176
  # @example Raise custom exception with extra constructor parameters by passing in an instance of the exception.
1157
1177
  # object = stub()
1158
1178
  # object.stubs(:expected_method).raises(MyException.new('message', 1, 2, 3))
@@ -1162,10 +1182,6 @@ class Mocha::Expectation
1162
1182
  # object.stubs(:expected_method).raises(Exception1).then.raises(Exception2)
1163
1183
  # object.expected_method # => raises exception of class Exception1
1164
1184
  # object.expected_method # => raises exception of class Exception2
1165
- # @example Raise specified exception if expected method is invoked.
1166
- # object = stub()
1167
- # object.stubs(:expected_method).raises(Exception, 'message')
1168
- # object.expected_method # => raises exception of class Exception and with message 'message'
1169
1185
  # @example Raise an exception on first invocation of expected method and then return values on subsequent invocations.
1170
1186
  # object = stub()
1171
1187
  # object.stubs(:expected_method).raises(Exception).then.returns(2, 3)
@@ -1225,7 +1241,7 @@ class Mocha::Expectation
1225
1241
  # @private
1226
1242
  # @return [Boolean]
1227
1243
  #
1228
- # source://mocha//lib/mocha/expectation.rb#651
1244
+ # source://mocha//lib/mocha/expectation.rb#657
1229
1245
  def satisfied?; end
1230
1246
 
1231
1247
  # @example Using {#then} as syntactic sugar when specifying values to be returned and exceptions to be raised on consecutive invocations of the expected method.
@@ -1254,14 +1270,14 @@ class Mocha::Expectation
1254
1270
 
1255
1271
  # 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)+.
1256
1272
  #
1257
- # @example Throw tag with return value +object+ c.f. +Kernel#throw+.
1258
- # object = stub()
1259
- # object.stubs(:expected_method).throws(:done, 'result')
1260
- # object.expected_method # => throws tag :done and causes catch block to return 'result'
1261
1273
  # @example Throw tag when expected method is invoked.
1262
1274
  # object = stub()
1263
1275
  # object.stubs(:expected_method).throws(:done)
1264
1276
  # object.expected_method # => throws tag :done
1277
+ # @example Throw tag with return value +object+ c.f. +Kernel#throw+.
1278
+ # object = stub()
1279
+ # object.stubs(:expected_method).throws(:done, 'result')
1280
+ # object.expected_method # => throws tag :done and causes catch block to return 'result'
1265
1281
  # @example Throw different tags on consecutive invocations of the expected method.
1266
1282
  # object = stub()
1267
1283
  # object.stubs(:expected_method).throws(:done).then.throws(:continue)
@@ -1339,13 +1355,13 @@ class Mocha::Expectation
1339
1355
  # @private
1340
1356
  # @return [Boolean]
1341
1357
  #
1342
- # source://mocha//lib/mocha/expectation.rb#669
1358
+ # source://mocha//lib/mocha/expectation.rb#675
1343
1359
  def used?; end
1344
1360
 
1345
1361
  # @private
1346
1362
  # @return [Boolean]
1347
1363
  #
1348
- # source://mocha//lib/mocha/expectation.rb#663
1364
+ # source://mocha//lib/mocha/expectation.rb#669
1349
1365
  def verified?(assertion_counter = T.unsafe(nil)); end
1350
1366
 
1351
1367
  # Constrains the expectation to occur only when the +state_machine+ is in the state specified by +state_predicate+.
@@ -1527,9 +1543,9 @@ class Mocha::ExpectationError < ::Exception; end
1527
1543
  #
1528
1544
  # This class should only be used by authors of test libraries and not by typical "users" of Mocha.
1529
1545
  #
1530
- # 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+.
1546
+ # 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+.
1531
1547
  #
1532
- # @see Mocha::Integration::MiniTest::Adapter
1548
+ # @see Mocha::Integration::Minitest::Adapter
1533
1549
  #
1534
1550
  # source://mocha//lib/mocha/expectation_error_factory.rb#12
1535
1551
  class Mocha::ExpectationErrorFactory
@@ -1567,7 +1583,7 @@ class Mocha::ExpectationList
1567
1583
  # source://mocha//lib/mocha/expectation_list.rb#3
1568
1584
  def initialize(expectations = T.unsafe(nil)); end
1569
1585
 
1570
- # source://mocha//lib/mocha/expectation_list.rb#48
1586
+ # source://mocha//lib/mocha/expectation_list.rb#52
1571
1587
  def +(other); end
1572
1588
 
1573
1589
  # source://mocha//lib/mocha/expectation_list.rb#7
@@ -1575,18 +1591,21 @@ class Mocha::ExpectationList
1575
1591
 
1576
1592
  # @return [Boolean]
1577
1593
  #
1578
- # source://mocha//lib/mocha/expectation_list.rb#44
1594
+ # source://mocha//lib/mocha/expectation_list.rb#48
1579
1595
  def any?; end
1580
1596
 
1581
- # source://mocha//lib/mocha/expectation_list.rb#40
1597
+ # source://mocha//lib/mocha/expectation_list.rb#44
1582
1598
  def length; end
1583
1599
 
1584
1600
  # source://mocha//lib/mocha/expectation_list.rb#20
1585
- def match(invocation); end
1601
+ def match(invocation, ignoring_order: T.unsafe(nil)); end
1586
1602
 
1587
- # source://mocha//lib/mocha/expectation_list.rb#24
1603
+ # source://mocha//lib/mocha/expectation_list.rb#28
1588
1604
  def match_allowing_invocation(invocation); end
1589
1605
 
1606
+ # source://mocha//lib/mocha/expectation_list.rb#24
1607
+ def match_but_out_of_order(invocation); end
1608
+
1590
1609
  # @return [Boolean]
1591
1610
  #
1592
1611
  # source://mocha//lib/mocha/expectation_list.rb#16
@@ -1595,21 +1614,21 @@ class Mocha::ExpectationList
1595
1614
  # source://mocha//lib/mocha/expectation_list.rb#12
1596
1615
  def remove_all_matching_method(method_name); end
1597
1616
 
1598
- # source://mocha//lib/mocha/expectation_list.rb#32
1617
+ # source://mocha//lib/mocha/expectation_list.rb#36
1599
1618
  def to_a; end
1600
1619
 
1601
- # source://mocha//lib/mocha/expectation_list.rb#36
1620
+ # source://mocha//lib/mocha/expectation_list.rb#40
1602
1621
  def to_set; end
1603
1622
 
1604
1623
  # @return [Boolean]
1605
1624
  #
1606
- # source://mocha//lib/mocha/expectation_list.rb#28
1625
+ # source://mocha//lib/mocha/expectation_list.rb#32
1607
1626
  def verified?(assertion_counter = T.unsafe(nil)); end
1608
1627
 
1609
1628
  private
1610
1629
 
1611
- # source://mocha//lib/mocha/expectation_list.rb#54
1612
- def matching_expectations(invocation); end
1630
+ # source://mocha//lib/mocha/expectation_list.rb#58
1631
+ def matching_expectations(invocation, ignoring_order: T.unsafe(nil)); end
1613
1632
  end
1614
1633
 
1615
1634
  # Integration hooks for test library authors.
@@ -1618,12 +1637,12 @@ end
1618
1637
  #
1619
1638
  # 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.
1620
1639
  #
1621
- # 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.
1640
+ # 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.
1622
1641
  #
1623
1642
  # 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.
1624
1643
  #
1625
1644
  # @see Mocha::Integration::TestUnit::Adapter
1626
- # @see Mocha::Integration::MiniTest::Adapter
1645
+ # @see Mocha::Integration::Minitest::Adapter
1627
1646
  # @see Mocha::ExpectationErrorFactory
1628
1647
  # @see Mocha::API
1629
1648
  #
@@ -1641,7 +1660,13 @@ module Mocha::Hooks
1641
1660
  # This method should be called after each individual test has finished (including after any "teardown" code).
1642
1661
  #
1643
1662
  # source://mocha//lib/mocha/hooks.rb#38
1644
- def mocha_teardown; end
1663
+ def mocha_teardown(origin = T.unsafe(nil)); end
1664
+
1665
+ # Returns a string representing the unit test name, to be included in some Mocha
1666
+ # to help track down potential bugs.
1667
+ #
1668
+ # source://mocha//lib/mocha/hooks.rb#44
1669
+ def mocha_test_name; end
1645
1670
 
1646
1671
  # Verifies that all mock expectations have been met (only for use by authors of test libraries).
1647
1672
  #
@@ -1752,55 +1777,60 @@ class Mocha::Integration::AssertionCounter
1752
1777
  def increment; end
1753
1778
  end
1754
1779
 
1755
- # source://mocha//lib/mocha/integration/mini_test/adapter.rb#7
1756
- module Mocha::Integration::MiniTest
1780
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#7
1781
+ module Mocha::Integration::Minitest
1757
1782
  class << self
1758
- # source://mocha//lib/mocha/integration/mini_test.rb#8
1783
+ # source://mocha//lib/mocha/integration/minitest.rb#8
1759
1784
  def activate; end
1760
1785
  end
1761
1786
  end
1762
1787
 
1763
- # Integrates Mocha into recent versions of MiniTest.
1788
+ # Integrates Mocha into recent versions of Minitest.
1764
1789
  #
1765
1790
  # See the source code for an example of how to integrate Mocha into a test library.
1766
1791
  #
1767
- # source://mocha//lib/mocha/integration/mini_test/adapter.rb#11
1768
- module Mocha::Integration::MiniTest::Adapter
1792
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#11
1793
+ module Mocha::Integration::Minitest::Adapter
1769
1794
  include ::Mocha::ParameterMatchers
1770
1795
  include ::Mocha::Hooks
1771
1796
  include ::Mocha::API
1772
1797
 
1773
1798
  # @private
1774
1799
  #
1775
- # source://mocha//lib/mocha/integration/mini_test/adapter.rb#45
1800
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#45
1776
1801
  def after_teardown; end
1777
1802
 
1778
1803
  # @private
1779
1804
  #
1780
- # source://mocha//lib/mocha/integration/mini_test/adapter.rb#30
1805
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#30
1781
1806
  def before_setup; end
1782
1807
 
1783
1808
  # @private
1784
1809
  #
1785
- # source://mocha//lib/mocha/integration/mini_test/adapter.rb#36
1810
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#36
1786
1811
  def before_teardown; end
1787
1812
 
1813
+ # @private
1814
+ #
1815
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#51
1816
+ def mocha_test_name; end
1817
+
1788
1818
  class << self
1789
1819
  # @private
1790
1820
  # @return [Boolean]
1791
1821
  #
1792
- # source://mocha//lib/mocha/integration/mini_test/adapter.rb#15
1793
- def applicable_to?(mini_test_version); end
1822
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#15
1823
+ def applicable_to?(minitest_version); end
1794
1824
 
1795
1825
  # @private
1796
1826
  #
1797
- # source://mocha//lib/mocha/integration/mini_test/adapter.rb#20
1827
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#20
1798
1828
  def description; end
1799
1829
 
1800
1830
  # @private
1801
1831
  # @private
1802
1832
  #
1803
- # source://mocha//lib/mocha/integration/mini_test/adapter.rb#25
1833
+ # source://mocha//lib/mocha/integration/minitest/adapter.rb#25
1804
1834
  def included(_mod); end
1805
1835
  end
1806
1836
  end
@@ -1955,12 +1985,12 @@ class Mocha::Mock
1955
1985
  # @private
1956
1986
  # @return [Mock] a new instance of Mock
1957
1987
  #
1958
- # source://mocha//lib/mocha/mock.rb#273
1988
+ # source://mocha//lib/mocha/mock.rb#275
1959
1989
  def initialize(mockery, name = T.unsafe(nil), receiver = T.unsafe(nil)); end
1960
1990
 
1961
1991
  # @private
1962
1992
  #
1963
- # source://mocha//lib/mocha/mock.rb#297
1993
+ # source://mocha//lib/mocha/mock.rb#299
1964
1994
  def __expectations__; end
1965
1995
 
1966
1996
  # Adds an expectation that the specified method must be called exactly once with any parameters.
@@ -1980,7 +2010,7 @@ class Mocha::Mock
1980
2010
  # object.expected_method # => error raised when expected method invoked second time
1981
2011
  # @example Setup multiple expectations using +expected_methods_vs_return_values+.
1982
2012
  # object = mock()
1983
- # object.expects(:expected_method_one => :result_one, :expected_method_two => :result_two)
2013
+ # object.expects(expected_method_one: :result_one, expected_method_two: :result_two)
1984
2014
  #
1985
2015
  # # is exactly equivalent to
1986
2016
  #
@@ -1997,7 +2027,7 @@ class Mocha::Mock
1997
2027
  # @private
1998
2028
  #
1999
2029
  # source://mocha//lib/mocha/mock.rb#346
2000
- def __expire__; end
2030
+ def __expire__(origin); end
2001
2031
 
2002
2032
  def __singleton_class__; end
2003
2033
 
@@ -2011,7 +2041,7 @@ class Mocha::Mock
2011
2041
  # # no error raised
2012
2042
  # @example Setup multiple expectations using +stubbed_methods_vs_return_values+.
2013
2043
  # object = mock()
2014
- # object.stubs(:stubbed_method_one => :result_one, :stubbed_method_two => :result_two)
2044
+ # object.stubs(stubbed_method_one: :result_one, stubbed_method_two: :result_two)
2015
2045
  #
2016
2046
  # # is exactly equivalent to
2017
2047
  #
@@ -2022,7 +2052,7 @@ class Mocha::Mock
2022
2052
  # @overload stubs
2023
2053
  # @return [Expectation] last-built expectation which can be further modified by methods on {Expectation}.
2024
2054
  #
2025
- # source://mocha//lib/mocha/mock.rb#148
2055
+ # source://mocha//lib/mocha/mock.rb#149
2026
2056
  def __stubs__(method_name_or_hash, backtrace = T.unsafe(nil)); end
2027
2057
 
2028
2058
  # @private
@@ -2033,7 +2063,7 @@ class Mocha::Mock
2033
2063
 
2034
2064
  # @private
2035
2065
  #
2036
- # source://mocha//lib/mocha/mock.rb#307
2066
+ # source://mocha//lib/mocha/mock.rb#309
2037
2067
  def all_expectations; end
2038
2068
 
2039
2069
  # @private
@@ -2049,7 +2079,7 @@ class Mocha::Mock
2049
2079
 
2050
2080
  # @private
2051
2081
  #
2052
- # source://mocha//lib/mocha/mock.rb#285
2082
+ # source://mocha//lib/mocha/mock.rb#287
2053
2083
  def everything_stubbed; end
2054
2084
 
2055
2085
  # Adds an expectation that the specified method must be called exactly once with any parameters.
@@ -2069,7 +2099,7 @@ class Mocha::Mock
2069
2099
  # object.expected_method # => error raised when expected method invoked second time
2070
2100
  # @example Setup multiple expectations using +expected_methods_vs_return_values+.
2071
2101
  # object = mock()
2072
- # object.expects(:expected_method_one => :result_one, :expected_method_two => :result_two)
2102
+ # object.expects(expected_method_one: :result_one, expected_method_two: :result_two)
2073
2103
  #
2074
2104
  # # is exactly equivalent to
2075
2105
  #
@@ -2095,7 +2125,7 @@ class Mocha::Mock
2095
2125
 
2096
2126
  # @private
2097
2127
  #
2098
- # source://mocha//lib/mocha/mock.rb#313
2128
+ # source://mocha//lib/mocha/mock.rb#314
2099
2129
  def method_missing(symbol, *arguments, **_arg2, &block); end
2100
2130
 
2101
2131
  # @private
@@ -2150,7 +2180,7 @@ class Mocha::Mock
2150
2180
  # @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
2151
2181
  # @see #responds_like_instance_of
2152
2182
  #
2153
- # source://mocha//lib/mocha/mock.rb#235
2183
+ # source://mocha//lib/mocha/mock.rb#237
2154
2184
  def quacks_like(responder); end
2155
2185
 
2156
2186
  # 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+.
@@ -2181,7 +2211,7 @@ class Mocha::Mock
2181
2211
  # @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
2182
2212
  # @see #responds_like
2183
2213
  #
2184
- # source://mocha//lib/mocha/mock.rb#268
2214
+ # source://mocha//lib/mocha/mock.rb#270
2185
2215
  def quacks_like_instance_of(responder_class); end
2186
2216
 
2187
2217
  # 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.
@@ -2231,7 +2261,7 @@ class Mocha::Mock
2231
2261
  # @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
2232
2262
  # @see #responds_like_instance_of
2233
2263
  #
2234
- # source://mocha//lib/mocha/mock.rb#235
2264
+ # source://mocha//lib/mocha/mock.rb#237
2235
2265
  def responds_like(responder); end
2236
2266
 
2237
2267
  # 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+.
@@ -2262,12 +2292,12 @@ class Mocha::Mock
2262
2292
  # @return [Mock] the same {Mock} instance, thereby allowing invocations of other {Mock} methods to be chained.
2263
2293
  # @see #responds_like
2264
2294
  #
2265
- # source://mocha//lib/mocha/mock.rb#268
2295
+ # source://mocha//lib/mocha/mock.rb#270
2266
2296
  def responds_like_instance_of(responder_class); end
2267
2297
 
2268
2298
  # @private
2269
2299
  #
2270
- # source://mocha//lib/mocha/mock.rb#302
2300
+ # source://mocha//lib/mocha/mock.rb#304
2271
2301
  def stub_everything; end
2272
2302
 
2273
2303
  # Adds an expectation that the specified method may be called any number of times with any parameters.
@@ -2280,7 +2310,7 @@ class Mocha::Mock
2280
2310
  # # no error raised
2281
2311
  # @example Setup multiple expectations using +stubbed_methods_vs_return_values+.
2282
2312
  # object = mock()
2283
- # object.stubs(:stubbed_method_one => :result_one, :stubbed_method_two => :result_two)
2313
+ # object.stubs(stubbed_method_one: :result_one, stubbed_method_two: :result_two)
2284
2314
  #
2285
2315
  # # is exactly equivalent to
2286
2316
  #
@@ -2291,7 +2321,7 @@ class Mocha::Mock
2291
2321
  # @overload stubs
2292
2322
  # @return [Expectation] last-built expectation which can be further modified by methods on {Expectation}.
2293
2323
  #
2294
- # source://mocha//lib/mocha/mock.rb#148
2324
+ # source://mocha//lib/mocha/mock.rb#149
2295
2325
  def stubs(method_name_or_hash, backtrace = T.unsafe(nil)); end
2296
2326
 
2297
2327
  # Removes the specified stubbed methods (added by calls to {#expects} or {#stubs}) and all expectations associated with them.
@@ -2311,17 +2341,17 @@ class Mocha::Mock
2311
2341
  # multiplier.unstub(:triple)
2312
2342
  # @param method_names [Array<Symbol>] names of methods to unstub.
2313
2343
  #
2314
- # source://mocha//lib/mocha/mock.rb#180
2344
+ # source://mocha//lib/mocha/mock.rb#182
2315
2345
  def unstub(*method_names); end
2316
2346
 
2317
2347
  private
2318
2348
 
2319
2349
  # @raise [StubbingError]
2320
2350
  #
2321
- # source://mocha//lib/mocha/mock.rb#389
2351
+ # source://mocha//lib/mocha/mock.rb#393
2322
2352
  def check_expiry; end
2323
2353
 
2324
- # source://mocha//lib/mocha/mock.rb#383
2354
+ # source://mocha//lib/mocha/mock.rb#387
2325
2355
  def check_responder_responds_to(symbol); end
2326
2356
 
2327
2357
  # source://mocha//lib/mocha/mock.rb#372
@@ -2336,17 +2366,17 @@ end
2336
2366
 
2337
2367
  # source://mocha//lib/mocha/mockery.rb#13
2338
2368
  class Mocha::Mockery
2339
- # source://mocha//lib/mocha/mockery.rb#134
2369
+ # source://mocha//lib/mocha/mockery.rb#138
2340
2370
  def logger; end
2341
2371
 
2342
2372
  # Sets the attribute logger
2343
2373
  #
2344
2374
  # @param value the value to set the attribute logger to.
2345
2375
  #
2346
- # source://mocha//lib/mocha/mockery.rb#132
2376
+ # source://mocha//lib/mocha/mockery.rb#136
2347
2377
  def logger=(_arg0); end
2348
2378
 
2349
- # source://mocha//lib/mocha/mockery.rb#112
2379
+ # source://mocha//lib/mocha/mockery.rb#116
2350
2380
  def mocha_inspect; end
2351
2381
 
2352
2382
  # source://mocha//lib/mocha/mockery.rb#66
@@ -2364,9 +2394,12 @@ class Mocha::Mockery
2364
2394
  # source://mocha//lib/mocha/mockery.rb#74
2365
2395
  def new_state_machine(name); end
2366
2396
 
2367
- # source://mocha//lib/mocha/mockery.rb#120
2397
+ # source://mocha//lib/mocha/mockery.rb#124
2368
2398
  def on_stubbing(object, method); end
2369
2399
 
2400
+ # source://mocha//lib/mocha/mockery.rb#112
2401
+ def sequences; end
2402
+
2370
2403
  # source://mocha//lib/mocha/mockery.rb#108
2371
2404
  def state_machines; end
2372
2405
 
@@ -2374,7 +2407,7 @@ class Mocha::Mockery
2374
2407
  def stubba; end
2375
2408
 
2376
2409
  # source://mocha//lib/mocha/mockery.rb#94
2377
- def teardown; end
2410
+ def teardown(origin = T.unsafe(nil)); end
2378
2411
 
2379
2412
  # source://mocha//lib/mocha/mockery.rb#62
2380
2413
  def unnamed_mock; end
@@ -2384,27 +2417,27 @@ class Mocha::Mockery
2384
2417
 
2385
2418
  private
2386
2419
 
2387
- # source://mocha//lib/mocha/mockery.rb#161
2420
+ # source://mocha//lib/mocha/mockery.rb#165
2388
2421
  def add_mock(mock); end
2389
2422
 
2390
- # source://mocha//lib/mocha/mockery.rb#166
2423
+ # source://mocha//lib/mocha/mockery.rb#170
2391
2424
  def add_state_machine(state_machine); end
2392
2425
 
2393
2426
  # @raise [StubbingError]
2394
2427
  #
2395
- # source://mocha//lib/mocha/mockery.rb#140
2428
+ # source://mocha//lib/mocha/mockery.rb#144
2396
2429
  def check(action, description, signature_proc, backtrace = T.unsafe(nil)); end
2397
2430
 
2398
- # source://mocha//lib/mocha/mockery.rb#149
2431
+ # source://mocha//lib/mocha/mockery.rb#153
2399
2432
  def expectations; end
2400
2433
 
2401
- # source://mocha//lib/mocha/mockery.rb#171
2434
+ # source://mocha//lib/mocha/mockery.rb#175
2402
2435
  def reset; end
2403
2436
 
2404
- # source://mocha//lib/mocha/mockery.rb#157
2437
+ # source://mocha//lib/mocha/mockery.rb#161
2405
2438
  def satisfied_expectations; end
2406
2439
 
2407
- # source://mocha//lib/mocha/mockery.rb#153
2440
+ # source://mocha//lib/mocha/mockery.rb#157
2408
2441
  def unsatisfied_expectations; end
2409
2442
 
2410
2443
  class << self
@@ -2415,7 +2448,7 @@ class Mocha::Mockery
2415
2448
  def setup; end
2416
2449
 
2417
2450
  # source://mocha//lib/mocha/mockery.rb#51
2418
- def teardown; end
2451
+ def teardown(origin = T.unsafe(nil)); end
2419
2452
 
2420
2453
  # source://mocha//lib/mocha/mockery.rb#47
2421
2454
  def verify(*args); end
@@ -2477,7 +2510,7 @@ module Mocha::ObjectMethods
2477
2510
  # assert_equal true, product.save
2478
2511
  # @example Setting up multiple expectations on a non-mock object.
2479
2512
  # product = Product.new
2480
- # product.expects(:valid? => true, :save => true)
2513
+ # product.expects(valid?: true, save: true)
2481
2514
  #
2482
2515
  # # exactly equivalent to
2483
2516
  #
@@ -2528,7 +2561,7 @@ module Mocha::ObjectMethods
2528
2561
  # assert_equal true, product.save
2529
2562
  # @example Setting up multiple stubbed methods on a non-mock object.
2530
2563
  # product = Product.new
2531
- # product.stubs(:valid? => true, :save => true)
2564
+ # product.stubs(valid?: true, save: true)
2532
2565
  #
2533
2566
  # # exactly equivalent to
2534
2567
  #
@@ -2840,7 +2873,7 @@ module Mocha::ParameterMatchers
2840
2873
  # @example Actual parameter includes item which matches nested matcher.
2841
2874
  # object = mock()
2842
2875
  # object.expects(:method_1).with(includes(has_key(:key)))
2843
- # object.method_1(['foo', 'bar', {:key => 'baz'}])
2876
+ # object.method_1(['foo', 'bar', {key: 'baz'}])
2844
2877
  # # no error raised
2845
2878
  # @example Actual parameter does not include item matching nested matcher.
2846
2879
  # object.method_1(['foo', 'bar', {:other_key => 'baz'}])
@@ -2856,10 +2889,10 @@ module Mocha::ParameterMatchers
2856
2889
  # @example Actual parameter is a Hash including the given key.
2857
2890
  # object = mock()
2858
2891
  # object.expects(:method_1).with(includes(:bar))
2859
- # object.method_1({:foo => 1, :bar => 2})
2892
+ # object.method_1({foo: 1, bar: 2})
2860
2893
  # # no error raised
2861
2894
  # @example Actual parameter is a Hash without the given key.
2862
- # object.method_1({:foo => 1, :baz => 2})
2895
+ # object.method_1({foo: 1, baz: 2})
2863
2896
  # # error raised, because hash does not include key 'bar'
2864
2897
  # @example Actual parameter is a Hash with a key matching the given matcher.
2865
2898
  # object = mock()
@@ -2985,8 +3018,6 @@ module Mocha::ParameterMatchers
2985
3018
  # source://mocha//lib/mocha/parameter_matchers/regexp_matches.rb#24
2986
3019
  def regexp_matches(regexp); end
2987
3020
 
2988
- # Matches any object that responds to +message+ with +result+. To put it another way, it tests the quack, not the duck.
2989
- #
2990
3021
  # @example Actual parameter responds with "FOO" when :upcase is invoked.
2991
3022
  # object = mock()
2992
3023
  # object.expects(:method_1).with(responds_with(:upcase, "FOO"))
@@ -2997,13 +3028,18 @@ module Mocha::ParameterMatchers
2997
3028
  # object.expects(:method_1).with(responds_with(:upcase, "BAR"))
2998
3029
  # object.method_1("foo")
2999
3030
  # # error raised, because "foo".upcase != "BAR"
3000
- # @param message [Symbol] method to invoke.
3001
- # @param result [Object] expected result of sending +message+.
3031
+ # @example Actual parameter responds with "FOO" when :upcase is invoked and "oof" when :reverse is invoked.
3032
+ # object = mock()
3033
+ # object.expects(:method_1).with(responds_with(upcase: "FOO", reverse: "oof"))
3034
+ # object.method_1("foo")
3035
+ # # no error raised, because "foo".upcase == "FOO" and "foo".reverse == "oof"
3036
+ # @overload responds_with
3037
+ # @overload responds_with
3002
3038
  # @return [RespondsWith] parameter matcher.
3003
3039
  # @see Expectation#with
3004
3040
  #
3005
- # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#25
3006
- def responds_with(message, result); end
3041
+ # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#37
3042
+ def responds_with(*options); end
3007
3043
 
3008
3044
  # Matches any YAML that represents the specified +object+
3009
3045
  #
@@ -3121,12 +3157,12 @@ class Mocha::ParameterMatchers::Base
3121
3157
  # @example Alternative ways to combine matchers with a logical AND.
3122
3158
  # object = mock()
3123
3159
  # object.expects(:run).with(all_of(has_key(:foo), has_key(:bar)))
3124
- # object.run(:foo => 'foovalue', :bar => 'barvalue')
3160
+ # object.run(foo: 'foovalue', bar: 'barvalue')
3125
3161
  #
3126
3162
  # # is exactly equivalent to
3127
3163
  #
3128
3164
  # object.expects(:run).with(has_key(:foo) & has_key(:bar))
3129
- # object.run(:foo => 'foovalue', :bar => 'barvalue)
3165
+ # object.run(foo: 'foovalue', bar: 'barvalue)
3130
3166
  # @param other [Base] parameter matcher.
3131
3167
  # @return [AllOf] parameter matcher.
3132
3168
  # @see Expectation#with
@@ -3148,12 +3184,12 @@ class Mocha::ParameterMatchers::Base
3148
3184
  # @example Alternative ways to combine matchers with a logical OR.
3149
3185
  # object = mock()
3150
3186
  # object.expects(:run).with(any_of(has_key(:foo), has_key(:bar)))
3151
- # object.run(:foo => 'foovalue')
3187
+ # object.run(foo: 'foovalue')
3152
3188
  #
3153
3189
  # # is exactly equivalent to
3154
3190
  #
3155
3191
  # object.expects(:run).with(has_key(:foo) | has_key(:bar))
3156
- # object.run(:foo => 'foovalue')
3192
+ # object.run(foo: 'foovalue')
3157
3193
  # @example Using an explicit {Equals} matcher in combination with {#|}.
3158
3194
  # object.expects(:run).with(equals(1) | equals(2))
3159
3195
  # object.run(1) # passes
@@ -3537,23 +3573,23 @@ end
3537
3573
 
3538
3574
  # Parameter matcher which matches if actual parameter returns expected result when specified method is invoked.
3539
3575
  #
3540
- # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#30
3576
+ # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#57
3541
3577
  class Mocha::ParameterMatchers::RespondsWith < ::Mocha::ParameterMatchers::Base
3542
3578
  # @private
3543
3579
  # @return [RespondsWith] a new instance of RespondsWith
3544
3580
  #
3545
- # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#32
3581
+ # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#59
3546
3582
  def initialize(message, result); end
3547
3583
 
3548
3584
  # @private
3549
3585
  # @return [Boolean]
3550
3586
  #
3551
- # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#38
3587
+ # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#65
3552
3588
  def matches?(available_parameters); end
3553
3589
 
3554
3590
  # @private
3555
3591
  #
3556
- # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#44
3592
+ # source://mocha//lib/mocha/parameter_matchers/responds_with.rb#71
3557
3593
  def mocha_inspect; end
3558
3594
  end
3559
3595