mocha 1.10.2 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.yardopts +1 -0
  4. data/RELEASE.md +18 -0
  5. data/Rakefile +1 -4
  6. data/docs/Mocha.html +2 -2
  7. data/docs/Mocha/API.html +2 -2
  8. data/docs/Mocha/ClassMethods.html +2 -2
  9. data/docs/Mocha/Configuration.html +2 -2
  10. data/docs/Mocha/Expectation.html +284 -76
  11. data/docs/Mocha/ExpectationError.html +2 -2
  12. data/docs/Mocha/ExpectationErrorFactory.html +2 -2
  13. data/docs/Mocha/Hooks.html +2 -2
  14. data/docs/Mocha/Integration.html +2 -2
  15. data/docs/Mocha/Integration/MiniTest.html +2 -2
  16. data/docs/Mocha/Integration/MiniTest/Adapter.html +2 -2
  17. data/docs/Mocha/Integration/TestUnit.html +2 -2
  18. data/docs/Mocha/Integration/TestUnit/Adapter.html +2 -2
  19. data/docs/Mocha/Mock.html +2 -2
  20. data/docs/Mocha/ObjectMethods.html +2 -2
  21. data/docs/Mocha/ParameterMatchers.html +2 -2
  22. data/docs/Mocha/ParameterMatchers/AllOf.html +2 -2
  23. data/docs/Mocha/ParameterMatchers/AnyOf.html +2 -2
  24. data/docs/Mocha/ParameterMatchers/AnyParameters.html +2 -2
  25. data/docs/Mocha/ParameterMatchers/Anything.html +2 -2
  26. data/docs/Mocha/ParameterMatchers/Base.html +2 -2
  27. data/docs/Mocha/ParameterMatchers/Equals.html +2 -2
  28. data/docs/Mocha/ParameterMatchers/EquivalentUri.html +2 -2
  29. data/docs/Mocha/ParameterMatchers/HasEntries.html +2 -2
  30. data/docs/Mocha/ParameterMatchers/HasEntry.html +2 -2
  31. data/docs/Mocha/ParameterMatchers/HasKey.html +2 -2
  32. data/docs/Mocha/ParameterMatchers/HasValue.html +2 -2
  33. data/docs/Mocha/ParameterMatchers/Includes.html +2 -2
  34. data/docs/Mocha/ParameterMatchers/InstanceOf.html +2 -2
  35. data/docs/Mocha/ParameterMatchers/IsA.html +2 -2
  36. data/docs/Mocha/ParameterMatchers/KindOf.html +2 -2
  37. data/docs/Mocha/ParameterMatchers/Not.html +2 -2
  38. data/docs/Mocha/ParameterMatchers/Optionally.html +2 -2
  39. data/docs/Mocha/ParameterMatchers/RegexpMatches.html +2 -2
  40. data/docs/Mocha/ParameterMatchers/RespondsWith.html +2 -2
  41. data/docs/Mocha/ParameterMatchers/YamlEquivalent.html +2 -2
  42. data/docs/Mocha/Sequence.html +2 -2
  43. data/docs/Mocha/StateMachine.html +2 -2
  44. data/docs/Mocha/StateMachine/State.html +2 -2
  45. data/docs/Mocha/StateMachine/StatePredicate.html +2 -2
  46. data/docs/Mocha/StubbingError.html +2 -2
  47. data/docs/_index.html +3 -3
  48. data/docs/file.COPYING.html +2 -2
  49. data/docs/file.MIT-LICENSE.html +2 -2
  50. data/docs/file.README.html +2 -2
  51. data/docs/file.RELEASE.html +30 -2
  52. data/docs/frames.html +1 -1
  53. data/docs/index.html +2 -2
  54. data/docs/method_list.html +20 -4
  55. data/docs/top-level-namespace.html +2 -2
  56. data/lib/mocha/block_matcher.rb +31 -0
  57. data/lib/mocha/expectation.rb +47 -6
  58. data/lib/mocha/invocation.rb +9 -5
  59. data/lib/mocha/version.rb +1 -1
  60. data/lib/mocha/yield_parameters.rb +5 -11
  61. data/test/acceptance/acceptance_test_helper.rb +1 -0
  62. data/test/acceptance/display_matching_invocations_alongside_expectations_test.rb +5 -5
  63. data/test/acceptance/failure_messages_test.rb +16 -0
  64. data/test/acceptance/multiple_yielding_test.rb +56 -0
  65. data/test/acceptance/yielding_test.rb +78 -0
  66. data/test/unit/expectation_test.rb +15 -1
  67. data/test/unit/yield_parameters_test.rb +35 -53
  68. metadata +6 -8
  69. data/lib/mocha/multiple_yields.rb +0 -15
  70. data/lib/mocha/no_yields.rb +0 -5
  71. data/lib/mocha/single_yield.rb +0 -13
  72. data/test/unit/multiple_yields_test.rb +0 -16
  73. data/test/unit/no_yields_test.rb +0 -16
  74. data/test/unit/single_yield_test.rb +0 -16
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Mead
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-12 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -74,6 +74,7 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - ".gemtest"
77
+ - ".github/FUNDING.yml"
77
78
  - ".rubocop.yml"
78
79
  - ".rubocop_todo.yml"
79
80
  - ".yardopts"
@@ -165,6 +166,7 @@ files:
165
166
  - lib/mocha/api.rb
166
167
  - lib/mocha/argument_iterator.rb
167
168
  - lib/mocha/backtrace_filter.rb
169
+ - lib/mocha/block_matcher.rb
168
170
  - lib/mocha/cardinality.rb
169
171
  - lib/mocha/central.rb
170
172
  - lib/mocha/change_state_side_effect.rb
@@ -217,9 +219,7 @@ files:
217
219
  - lib/mocha/minitest.rb
218
220
  - lib/mocha/mock.rb
219
221
  - lib/mocha/mockery.rb
220
- - lib/mocha/multiple_yields.rb
221
222
  - lib/mocha/names.rb
222
- - lib/mocha/no_yields.rb
223
223
  - lib/mocha/not_initialized_error.rb
224
224
  - lib/mocha/object_methods.rb
225
225
  - lib/mocha/parameter_matchers.rb
@@ -253,7 +253,6 @@ files:
253
253
  - lib/mocha/sequence.rb
254
254
  - lib/mocha/setup.rb
255
255
  - lib/mocha/single_return_value.rb
256
- - lib/mocha/single_yield.rb
257
256
  - lib/mocha/singleton_class.rb
258
257
  - lib/mocha/state_machine.rb
259
258
  - lib/mocha/stubbed_method.rb
@@ -282,6 +281,7 @@ files:
282
281
  - test/acceptance/mock_test.rb
283
282
  - test/acceptance/mocked_methods_dispatch_test.rb
284
283
  - test/acceptance/multiple_expectations_failure_message_test.rb
284
+ - test/acceptance/multiple_yielding_test.rb
285
285
  - test/acceptance/optional_parameters_test.rb
286
286
  - test/acceptance/parameter_matcher_test.rb
287
287
  - test/acceptance/partial_mocks_test.rb
@@ -327,6 +327,7 @@ files:
327
327
  - test/acceptance/throw_test.rb
328
328
  - test/acceptance/unexpected_invocation_test.rb
329
329
  - test/acceptance/unstubbing_test.rb
330
+ - test/acceptance/yielding_test.rb
330
331
  - test/assertions.rb
331
332
  - test/deprecation_disabler.rb
332
333
  - test/execution_point.rb
@@ -360,8 +361,6 @@ files:
360
361
  - test/unit/mock_test.rb
361
362
  - test/unit/mockery_test.rb
362
363
  - test/unit/module_methods_test.rb
363
- - test/unit/multiple_yields_test.rb
364
- - test/unit/no_yields_test.rb
365
364
  - test/unit/object_inspect_test.rb
366
365
  - test/unit/object_methods_test.rb
367
366
  - test/unit/parameter_matchers/all_of_test.rb
@@ -387,7 +386,6 @@ files:
387
386
  - test/unit/return_values_test.rb
388
387
  - test/unit/sequence_test.rb
389
388
  - test/unit/single_return_value_test.rb
390
- - test/unit/single_yield_test.rb
391
389
  - test/unit/state_machine_test.rb
392
390
  - test/unit/string_inspect_test.rb
393
391
  - test/unit/thrower_test.rb
@@ -1,15 +0,0 @@
1
- module Mocha
2
- class MultipleYields
3
- attr_reader :parameter_groups
4
-
5
- def initialize(*parameter_groups)
6
- @parameter_groups = parameter_groups
7
- end
8
-
9
- def each
10
- @parameter_groups.each do |parameter_group|
11
- yield(parameter_group)
12
- end
13
- end
14
- end
15
- end
@@ -1,5 +0,0 @@
1
- module Mocha
2
- class NoYields
3
- def each; end
4
- end
5
- end
@@ -1,13 +0,0 @@
1
- module Mocha
2
- class SingleYield
3
- attr_reader :parameters
4
-
5
- def initialize(*parameters)
6
- @parameters = parameters
7
- end
8
-
9
- def each
10
- yield(@parameters)
11
- end
12
- end
13
- end
@@ -1,16 +0,0 @@
1
- require File.expand_path('../../test_helper', __FILE__)
2
-
3
- require 'mocha/multiple_yields'
4
-
5
- class MultipleYieldsTest < Mocha::TestCase
6
- include Mocha
7
-
8
- def test_should_provide_parameters_for_multiple_yields_in_single_invocation
9
- parameter_group = MultipleYields.new([1, 2, 3], [4, 5])
10
- parameter_groups = []
11
- parameter_group.each do |parameters|
12
- parameter_groups << parameters
13
- end
14
- assert_equal [[1, 2, 3], [4, 5]], parameter_groups
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- require File.expand_path('../../test_helper', __FILE__)
2
-
3
- require 'mocha/no_yields'
4
-
5
- class NoYieldsTest < Mocha::TestCase
6
- include Mocha
7
-
8
- def test_should_provide_parameters_for_no_yields_in_single_invocation
9
- parameter_group = NoYields.new
10
- parameter_groups = []
11
- parameter_group.each do |parameters|
12
- parameter_groups << parameters
13
- end
14
- assert_equal [], parameter_groups
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- require File.expand_path('../../test_helper', __FILE__)
2
-
3
- require 'mocha/single_yield'
4
-
5
- class SingleYieldTest < Mocha::TestCase
6
- include Mocha
7
-
8
- def test_should_provide_parameters_for_single_yield_in_single_invocation
9
- parameter_group = SingleYield.new(1, 2, 3)
10
- parameter_groups = []
11
- parameter_group.each do |parameters|
12
- parameter_groups << parameters
13
- end
14
- assert_equal [[1, 2, 3]], parameter_groups
15
- end
16
- end