mocha 2.4.5 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/README.md +1 -7
- data/RELEASE.md +88 -0
- data/lib/mocha/cardinality.rb +4 -0
- data/lib/mocha/expectation.rb +5 -0
- data/lib/mocha/expectation_list.rb +4 -6
- data/lib/mocha/mock.rb +23 -3
- data/lib/mocha/mockery.rb +5 -5
- data/lib/mocha/ruby_version.rb +1 -0
- data/lib/mocha/version.rb +1 -1
- data/mocha.gemspec +8 -0
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a2fb97d6eb77787f83c9199c83fcadd3605a07ec431a5e3d47a0d2ee6ff2c67
|
4
|
+
data.tar.gz: 42815979d195d003a14b42f36c4818fa6b1ca59d498e5ca3b743338a6dc13af8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b3494f44f9b603513afa227fd58f499275155695ae2c5e6759f11a0288d4f0fc706d2be90c01e12b8166caf328a8caf543303671310f91a4e3f28b130319973
|
7
|
+
data.tar.gz: d8b24445529930e616433246b41e43c78f034842967dff64df9c026be1dab5b5f3b671115d984608166caae6e7a73d253dc8e12bcca8b60514aefbd0520b9c76
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -121,13 +121,7 @@ Follow the instructions for the relevant test framework in the [Bundler](#bundle
|
|
121
121
|
|
122
122
|
#### Known Issues
|
123
123
|
|
124
|
-
*
|
125
|
-
* In Mocha v1.2.0 there is a scenario where stubbing a class method originally defined in a module hangs the Ruby interpreter due to [a bug in Ruby v2.3.1](https://bugs.ruby-lang.org/issues/12832). See #272. This was fixed in Mocha v1.2.1.
|
126
|
-
* Since v1.1.0 Mocha has used prepended modules internally for stubbing methods. There is [an obscure Ruby bug](https://bugs.ruby-lang.org/issues/12876) in many (but not all) versions of Ruby between v2.0 & v2.3 which under certain circumstances may cause your Ruby interpreter to hang. See the Ruby bug report for more details. The bug has been fixed in Ruby v2.3.3 & v2.4.0.
|
127
|
-
* Stubbing an aliased class method, where the original method is defined in a module that's used to `extend` the class doesn't work in Ruby 1.8.x. See stub_method_defined_on_module_and_aliased_test.rb for an example of this behaviour.
|
128
|
-
* 0.13.x versions cause a harmless, but annoying, deprecation warning when used with Rails 3.2.0-3.2.12, 3.1.0-3.1.10 & 3.0.0-3.0.19.
|
129
|
-
* 0.11.x versions don't work with Rails 3.2.13 (`TypeError: superclass mismatch for class ExpectationError`). See #115.
|
130
|
-
* Versions 0.10.2, 0.10.3 & 0.11.0 of the Mocha gem were broken. Please do not use these versions.
|
124
|
+
* Prior to v1.15.0 (when support for Ruby v1.8 was dropped), stubbing an aliased class method where the original method is defined in a module that's used to `extend` the class doesn't work in Ruby v1.8. See `test/acceptance/stub_method_defined_on_module_and_aliased_test.rb` for an example of this behaviour.
|
131
125
|
|
132
126
|
### Usage
|
133
127
|
|
data/RELEASE.md
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
# Release Notes
|
2
2
|
|
3
|
+
## 2.6.0
|
4
|
+
|
5
|
+
### External changes
|
6
|
+
|
7
|
+
* Expectation with never cardinality should display deprecation warning (#681) - thanks to @ducmtran for reporting and testing
|
8
|
+
|
9
|
+
### Internal changes
|
10
|
+
|
11
|
+
* Simplify backtrace related assertions (#680)
|
12
|
+
* Remove unused `ExpectationList#match_but_out_of_order` (f2fa9919)
|
13
|
+
|
14
|
+
## 2.5.0
|
15
|
+
|
16
|
+
### External changes
|
17
|
+
|
18
|
+
* Add metadata to gem specification, including `changelog_uri` (#608, eb1b8ea2) - thanks to @mattbrictson
|
19
|
+
* Fix warnings in Ruby v3.4 (#672, #669) - thanks to @radville for reporting
|
20
|
+
* Add warnings & notes about regressions, known issues, etc to release notes (#675, #676 & #677) - thanks to @davidstosik
|
21
|
+
|
22
|
+
### Internal changes
|
23
|
+
|
24
|
+
* Fix `jaro_winkler` compilation errors on MacOS (5c7d14cb)
|
25
|
+
* Fix typos in `IncludesTest` test names (6fb5a5a6)
|
26
|
+
* Fix `rubocop` version constraint for Ruby > v2.2.0 (d5c6b98a)
|
27
|
+
|
3
28
|
## 2.4.5
|
4
29
|
|
5
30
|
### External changes
|
@@ -12,18 +37,28 @@
|
|
12
37
|
|
13
38
|
* Fix regression when method expecting `Hash` parameter or keyword arguments is invoked with no arguments (#662, #663) - thanks to @vlad-pisanov for reporting
|
14
39
|
|
40
|
+
**WARNING: This release includes a regression:**
|
41
|
+
* A `NoMethodError` was raised when a stubbed method was expecting a `Hash`, but was invoked with an instance of `ActionController::Parameters`. See #662 for the report and #664 for the fix which was released in v2.4.5.
|
42
|
+
|
15
43
|
## 2.4.3
|
16
44
|
|
17
45
|
### External changes
|
18
46
|
|
19
47
|
* Fix regression when matching `Hash` parameter or keyword arguments (#657, #660) - thanks to @josesei for reporting and testing
|
20
48
|
|
49
|
+
**WARNING: This release inadvertently introduced a couple of regressions:**
|
50
|
+
* A `NoMethodError` was raised when a stubbed method was expecting a `Hash`, but was invoked with no arguments, e.g. with `C.expects(:foo).with(bar: 42)` and invoking `C.expects(:foo)`. See #662 for the report and #663 for the fix which was released in v2.4.4.
|
51
|
+
* A `NoMethodError` was raised when a stubbed method was expecting a `Hash`, but was invoked with an instance of `ActionController::Parameters`. See #662 for the report and #664 for the fix which was released in v2.4.5.
|
52
|
+
|
21
53
|
## 2.4.2
|
22
54
|
|
23
55
|
### External changes
|
24
56
|
|
25
57
|
* Don't trust `Object#is_a?` in presence of mock objects (#656) - thanks to @casperisfine
|
26
58
|
|
59
|
+
**WARNING: This release includes a regression:**
|
60
|
+
* Keyword argument and top-level `Hash` matching became more relaxed than intended, e.g. `mock.expects(:method).with(key: "value")` accepted `mock.method(key: "value", key2: "value")` when it should not have done. See #657 & #675 for the reports and #660 for the fix which was released in v2.4.3.
|
61
|
+
|
27
62
|
## 2.4.1
|
28
63
|
|
29
64
|
### External changes
|
@@ -35,6 +70,9 @@
|
|
35
70
|
* Reduce duplication & consolidate `#to_matcher` method definitions (600ee2aa, e9de64e4, #655)
|
36
71
|
* Change `#to_matcher` method to use keyword arguments (3b60b7df, #655)
|
37
72
|
|
73
|
+
**WARNING: This release includes a regression:**
|
74
|
+
* Keyword argument and top-level `Hash` matching became more relaxed than intended, e.g. `mock.expects(:method).with(key: "value")` accepted `mock.method(key: "value", key2: "value")` when it should not have done. See #657 & #675 for the reports and #660 for the fix which was released in v2.4.3.
|
75
|
+
|
38
76
|
## 2.4.0
|
39
77
|
|
40
78
|
### External changes
|
@@ -43,6 +81,10 @@
|
|
43
81
|
|
44
82
|
### Internal changes
|
45
83
|
|
84
|
+
**WARNING: This release includes a couple of regressions:**
|
85
|
+
* Nested parameter matching for keyword arguments became more relaxed than intended, e.g. `mock.expects(:method).with(has_entry(:k1, k2: 'v2'))` accepted `mock.method(k1: { k2: 'v2', k3: 'v3' })` when it should not have done. See #654 for the report and #655 for the fix which was released in v2.4.1.
|
86
|
+
* Keyword argument and top-level `Hash` matching became more relaxed than intended, e.g. `mock.expects(:method).with(key: "value")` accepted `mock.method(key: "value", key2: "value")` when it should not have done. See #657 & #675 for the reports and #660 for the fix which was released in v2.4.3.
|
87
|
+
|
46
88
|
* Improvements to `#mocha_inspect` unit tests (#650)
|
47
89
|
|
48
90
|
## 2.3.0
|
@@ -51,6 +93,10 @@
|
|
51
93
|
|
52
94
|
* Fix nested parameter matching for keyword arguments (f94e2504, #648) - thanks to @CodingAnarchy for reporting
|
53
95
|
|
96
|
+
**WARNING: This release inadvertently introduced a couple of regressions:**
|
97
|
+
* Nested parameter matching for keyword arguments became more relaxed than intended, e.g. `mock.expects(:method).with(has_entry(:k1, k2: 'v2'))` accepted `mock.method(k1: { k2: 'v2', k3: 'v3' })` when it should not have done. See #654 for the report and #655 for the fix which was released in v2.4.1.
|
98
|
+
* Keyword argument and top-level `Hash` matching became more relaxed than intended, e.g. `mock.expects(:method).with(key: "value")` accepted `mock.method(key: "value", key2: "value")` when it should not have done. See #657 & #675 for the reports and #660 for the fix which was released in v2.4.3.
|
99
|
+
|
54
100
|
## 2.2.0
|
55
101
|
|
56
102
|
### External changes
|
@@ -322,6 +368,9 @@ from the Ruby v1.8 standard library are no longer supported (#540,969f4845)
|
|
322
368
|
* Add documentation for Cucumber integration (13ab797b)
|
323
369
|
* Add documentation about an undocumented feature of `API#mock`, `API#stub` & `API#stub_everything` being changed (7ed2e4e7, d30c1717)
|
324
370
|
|
371
|
+
**WARNING: This release inadvertently changed some undocumented behaviour:**
|
372
|
+
* An undocumented feature of `API#mock`, `API#stub` & `API#stub_everything` was changed. Previously when these methods were passed a single symbol, they returned a mock object that responded to the method identified by the symbol. Now Passing a single symbol is equivalent to passing a single string, i.e. it now defines the 'name' of the mock object.
|
373
|
+
|
325
374
|
## 1.10.0.beta.1
|
326
375
|
|
327
376
|
* Hide `ClassMethods#method_visibility` & `#method_exists?` methods to avoid clash with Rails (#428)
|
@@ -465,6 +514,9 @@ from the Ruby v1.8 standard library are no longer supported (#540,969f4845)
|
|
465
514
|
* Fix typo in docs for equals - thanks to @alexcoco (#254)
|
466
515
|
* Add known issue for Ruby v1.8 to README - thanks to @chrisroos (2c642096)
|
467
516
|
|
517
|
+
**WARNING: This release inadvertently introduced the possibility of causing the Ruby interpreter to hang:**
|
518
|
+
* There is a scenario where stubbing a class method originally defined in a module hangs the Ruby interpreter due to [a bug in Ruby v2.3.1](https://bugs.ruby-lang.org/issues/12832). See #272. This was fixed in Mocha v1.2.1.
|
519
|
+
|
468
520
|
## 1.1.0
|
469
521
|
|
470
522
|
* Set visibility of any instance stub method.
|
@@ -473,6 +525,9 @@ from the Ruby v1.8 standard library are no longer supported (#540,969f4845)
|
|
473
525
|
* Use GitHub convention for instructions on contributing to Mocha.
|
474
526
|
* Fix typos in docs. Thanks to @10io
|
475
527
|
|
528
|
+
**WARNING: This release inadvertently introduced the possibility of causing the Ruby interpreter to hang:**
|
529
|
+
* From this release onwards, prepended modules have been used internally for stubbing methods. There is [an obscure Ruby bug](https://bugs.ruby-lang.org/issues/12876) in many (but not all) versions of Ruby between v2.0 & v2.3 which under certain circumstances may cause your Ruby interpreter to hang. See the Ruby bug report for more details. The bug has been fixed in Ruby v2.3.3 & v2.4.0.
|
530
|
+
|
476
531
|
## 1.0.0
|
477
532
|
|
478
533
|
### External changes
|
@@ -535,6 +590,9 @@ relevant patch version.
|
|
535
590
|
* Adapt Mocha acceptance tests to cope with changes in output from latest (v4.6.2) of MiniTest.
|
536
591
|
* Updates to README about Rails compatibility.
|
537
592
|
|
593
|
+
**NOTE: This release inadvertently caused deprecation warnings in some contexts:**
|
594
|
+
* When used with Rails v3.2.0-v3.2.12, v3.1.0-v3.1.10 & v3.0.0-v3.0.19.
|
595
|
+
|
538
596
|
## 0.13.2
|
539
597
|
* Stubbing of methods re-declared with different visibilty. Fixes #109.
|
540
598
|
* Add `Mock#responds_like_instance_of`. Fixes #119.
|
@@ -544,10 +602,16 @@ relevant patch version.
|
|
544
602
|
* Add a Gem Badge to provide a link to Mocha on Rubygems.
|
545
603
|
* Make documentation example consistent with other examples.
|
546
604
|
|
605
|
+
**NOTE: This release inadvertently caused deprecation warnings in some contexts:**
|
606
|
+
* When used with Rails v3.2.0-v3.2.12, v3.1.0-v3.1.10 & v3.0.0-v3.0.19.
|
607
|
+
|
547
608
|
## 0.13.1
|
548
609
|
* Fix #97 - `Mocha::ParameterMatchers#has_entry` does not work with an Array as the entry's value. Thanks to @ngokli.
|
549
610
|
* Allow deprecation `:debug` mode to be switched on from `MOCHA_OPTIONS` environment variable.
|
550
611
|
|
612
|
+
**NOTE: This release inadvertently caused deprecation warnings in some contexts:**
|
613
|
+
* When used with Rails v3.2.0-v3.2.12, v3.1.0-v3.1.10 & v3.0.0-v3.0.19.
|
614
|
+
|
551
615
|
## 0.13.0
|
552
616
|
* Major overhaul of MiniTest & Test::Unit integration. Mocha now integrates with later versions of the two test libraries using documented hooks rather than monkey-patching. This should mean that Mocha will integrate with new versions of either library without the need to release a new version of Mocha each time, which was clearly bad and unsustainable. Many thanks to @tenderlove, @zenspider & @kou for their help, suggestions & patience.
|
553
617
|
* Temporarily deprecated `require 'mocha'`. Use `require 'mocha/setup'` instead. The plan is that eventually `require 'mocha'` will *not* automatically integrate with either of the two test libraries as it does at the moment, and you'll need to explicitly & separately trigger the integration. I think this will provide a lot more flexibility and will hopefully do away with the need for the `require: false` option in the `Gemfile` which has always confused people.
|
@@ -560,6 +624,9 @@ relevant patch version.
|
|
560
624
|
* Various improvements to automated testing of integration with test libraries.
|
561
625
|
* Make deprecation warnings more prominent.
|
562
626
|
|
627
|
+
**NOTE: This release inadvertently caused deprecation warnings in some contexts:**
|
628
|
+
* When used with Rails v3.2.0-v3.2.12, v3.1.0-v3.1.10 & v3.0.0-v3.0.19.
|
629
|
+
|
563
630
|
## 0.12.7
|
564
631
|
* Officially support minitest v4.1.0 (still monkey-patching).
|
565
632
|
|
@@ -596,15 +663,27 @@ relevant patch version.
|
|
596
663
|
## 0.11.4
|
597
664
|
* Homepage has moved to http://gofreerange.com/mocha/docs.
|
598
665
|
|
666
|
+
**WARNING: This release inadvertently included a Rails compatibility issue:**
|
667
|
+
* `TypeError: superclass mismatch for class ExpectationError` raised when using Rails v3.2.13. See #115.
|
668
|
+
|
599
669
|
## 0.11.3
|
600
670
|
* Fix for #78 i.e. alias Object#method as Object#_method, not Object#__method__ which already exists as another Ruby method.
|
601
671
|
|
672
|
+
**WARNING: This release inadvertently included a Rails compatibility issue:**
|
673
|
+
* `TypeError: superclass mismatch for class ExpectationError` raised when using Rails v3.2.13. See #115.
|
674
|
+
|
602
675
|
## 0.11.2
|
603
676
|
* Rails has a Request class which defines its own #method method. This broke the new mechanism for stubbing a method. This release includes a slightly modified version of fix #77 provided by @sikachu. See https://github.com/rails/rails/pull/5907 for further info.
|
604
677
|
|
678
|
+
**WARNING: This release inadvertently included a Rails compatibility issue:**
|
679
|
+
* `TypeError: superclass mismatch for class ExpectationError` raised when using Rails v3.2.13. See #115.
|
680
|
+
|
605
681
|
## 0.11.1
|
606
682
|
* In Ruby 1.8.7 methods accepting a block parameter were incorrectly restored without the block parameter after being stubbed. Fix for #76.
|
607
683
|
|
684
|
+
**WARNING: This release inadvertently included a Rails compatibility issue:**
|
685
|
+
* `TypeError: superclass mismatch for class ExpectationError` raised when using Rails v3.2.13. See #115.
|
686
|
+
|
608
687
|
## 0.11.0
|
609
688
|
* Store original method when stubbing rather than using alias_method. This fixes #41, #47, #74 and all tests now pass on both Ruby 1.8.7 and 1.9.3.
|
610
689
|
* Attempting to stub a method on a frozen object should fail fast. See #68.
|
@@ -617,6 +696,11 @@ relevant patch version.
|
|
617
696
|
* Improve documentation for ObjectMethods.
|
618
697
|
* Provide a way to run multiple tests within a single acceptance test method.
|
619
698
|
|
699
|
+
**WARNING: This release inadvertently included a significant bug - please do not use it!**
|
700
|
+
|
701
|
+
**WARNING: This release inadvertently introduced a Rails compatibility issue:**
|
702
|
+
* `TypeError: superclass mismatch for class ExpectationError` raised when using Rails v3.2.13. See #115.
|
703
|
+
|
620
704
|
## 0.10.5
|
621
705
|
* Fix for issue #66 (hopefully without regressing on issue #63) - Mocha::Mock has Mocha::Mockery as a dependency. Stop trying to pretend otherwise. Thanks to @kennyj for reporting.
|
622
706
|
* Fix a bunch of warnings in Ruby 1.9. There are still the 6 test failures mentioned in issue #41 which I suspect are due to the introspection gem not being Ruby 1.9-compatible.
|
@@ -635,9 +719,13 @@ Hash with wrong number of entries.
|
|
635
719
|
## 0.10.3
|
636
720
|
* Fix for issue #57. Gem::Requirement#=~ was only added in rubygems v1.8.0, but Object#=~ means the result of various monkey-patching checks is always false/nil for earlier versions of rubygems. However, the method it aliases #satisfied_by? has existed since Gem::Dependency was extracted from Gem::Version in rubygems v0.9.4.4, so it's much safer to use that. Thanks to fguillen for reporting and helping with diagnosis.
|
637
721
|
|
722
|
+
**WARNING: This release inadvertently included a significant bug - please do not use it!**
|
723
|
+
|
638
724
|
## 0.10.2
|
639
725
|
* Merge pull request #53. Unstubbing a method should not remove expectations for other stubbed methods. Fixes #52. Thanks to saikat.
|
640
726
|
|
727
|
+
**WARNING: This release inadvertently included a significant bug - please do not use it!**
|
728
|
+
|
641
729
|
## 0.10.1
|
642
730
|
* Merge pull request #51. Use Gem::Requirement & Gem::Version for version comparison. Fixes issue #50. Thanks to meineerde.
|
643
731
|
* Fixed typo in rdoc for Mocha::ObjectMethods.
|
data/lib/mocha/cardinality.rb
CHANGED
data/lib/mocha/expectation.rb
CHANGED
@@ -21,14 +21,14 @@ module Mocha
|
|
21
21
|
matching_expectations(invocation, ignoring_order: ignoring_order).first
|
22
22
|
end
|
23
23
|
|
24
|
-
def match_but_out_of_order(invocation)
|
25
|
-
matching_expectations(invocation).first
|
26
|
-
end
|
27
|
-
|
28
24
|
def match_allowing_invocation(invocation)
|
29
25
|
matching_expectations(invocation).detect(&:invocations_allowed?)
|
30
26
|
end
|
31
27
|
|
28
|
+
def match_never_allowing_invocation(invocation)
|
29
|
+
matching_expectations(invocation).detect(&:invocations_never_allowed?)
|
30
|
+
end
|
31
|
+
|
32
32
|
def verified?(assertion_counter = nil)
|
33
33
|
@expectations.all? { |expectation| expectation.verified?(assertion_counter) }
|
34
34
|
end
|
@@ -53,8 +53,6 @@ module Mocha
|
|
53
53
|
self.class.new(to_a + other.to_a)
|
54
54
|
end
|
55
55
|
|
56
|
-
private
|
57
|
-
|
58
56
|
def matching_expectations(invocation, ignoring_order: false)
|
59
57
|
@expectations.select { |e| e.match?(invocation, ignoring_order: ignoring_order) }
|
60
58
|
end
|
data/lib/mocha/mock.rb
CHANGED
@@ -8,6 +8,7 @@ require 'mocha/method_matcher'
|
|
8
8
|
require 'mocha/parameters_matcher'
|
9
9
|
require 'mocha/argument_iterator'
|
10
10
|
require 'mocha/expectation_error_factory'
|
11
|
+
require 'mocha/deprecation'
|
11
12
|
|
12
13
|
module Mocha
|
13
14
|
# Traditional mock object.
|
@@ -321,10 +322,21 @@ module Mocha
|
|
321
322
|
check_expiry
|
322
323
|
check_responder_responds_to(symbol)
|
323
324
|
invocation = Invocation.new(self, symbol, arguments, block)
|
324
|
-
|
325
|
+
|
326
|
+
matching_expectations = all_expectations.matching_expectations(invocation)
|
327
|
+
matching_expectation_allowing_invocation = matching_expectations.detect(&:invocations_allowed?)
|
328
|
+
matching_expectation_never_allowing_invocation = matching_expectations.detect(&:invocations_never_allowed?)
|
329
|
+
|
330
|
+
if matching_expectation_allowing_invocation
|
331
|
+
if matching_expectation_never_allowing_invocation
|
332
|
+
invocation_not_allowed_warning(invocation, matching_expectation_never_allowing_invocation)
|
333
|
+
end
|
325
334
|
matching_expectation_allowing_invocation.invoke(invocation)
|
326
|
-
|
327
|
-
|
335
|
+
else
|
336
|
+
matching_expectation_ignoring_order = all_expectations.match(invocation, ignoring_order: true)
|
337
|
+
if matching_expectation_ignoring_order || (!matching_expectation_ignoring_order && !@everything_stubbed)
|
338
|
+
raise_unexpected_invocation_error(invocation, matching_expectation_ignoring_order)
|
339
|
+
end
|
328
340
|
end
|
329
341
|
end
|
330
342
|
|
@@ -369,6 +381,14 @@ module Mocha
|
|
369
381
|
|
370
382
|
private
|
371
383
|
|
384
|
+
def invocation_not_allowed_warning(invocation, expectation)
|
385
|
+
messages = [
|
386
|
+
"The expectation defined at #{expectation.definition_location} does not allow invocations, but #{invocation.call_description} was invoked.",
|
387
|
+
'This invocation will cause the test to fail fast in a future version of Mocha.'
|
388
|
+
]
|
389
|
+
Deprecation.warning(messages.join(' '))
|
390
|
+
end
|
391
|
+
|
372
392
|
def raise_unexpected_invocation_error(invocation, matching_expectation)
|
373
393
|
if @unexpected_invocation.nil?
|
374
394
|
@unexpected_invocation = invocation
|
data/lib/mocha/mockery.rb
CHANGED
@@ -114,11 +114,11 @@ module Mocha
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def mocha_inspect
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
117
|
+
lines = []
|
118
|
+
lines << "unsatisfied expectations:\n- #{unsatisfied_expectations.map(&:mocha_inspect).join("\n- ")}\n" if unsatisfied_expectations.any?
|
119
|
+
lines << "satisfied expectations:\n- #{satisfied_expectations.map(&:mocha_inspect).join("\n- ")}\n" if satisfied_expectations.any?
|
120
|
+
lines << "states:\n- #{state_machines.map(&:mocha_inspect).join("\n- ")}\n" if state_machines.any?
|
121
|
+
lines.join
|
122
122
|
end
|
123
123
|
|
124
124
|
def on_stubbing(object, method)
|
data/lib/mocha/ruby_version.rb
CHANGED
data/lib/mocha/version.rb
CHANGED
data/mocha.gemspec
CHANGED
@@ -21,6 +21,14 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.homepage = 'https://mocha.jamesmead.org'
|
22
22
|
s.require_paths = ['lib']
|
23
23
|
s.summary = 'Mocking and stubbing library'
|
24
|
+
s.metadata = {
|
25
|
+
'bug_tracker_uri' => 'https://github.com/freerange/mocha/issues',
|
26
|
+
'changelog_uri' => 'https://github.com/freerange/mocha/blob/main/RELEASE.md',
|
27
|
+
'documentation_uri' => 'https://mocha.jamesmead.org/',
|
28
|
+
'funding_uri' => 'https://github.com/sponsors/floehopper',
|
29
|
+
'homepage_uri' => s.homepage,
|
30
|
+
'source_code_uri' => 'https://github.com/freerange/mocha'
|
31
|
+
}
|
24
32
|
|
25
33
|
s.add_runtime_dependency 'ruby2_keywords', '>= 0.0.5'
|
26
34
|
end
|
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: 2.
|
4
|
+
version: 2.6.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: 2024-
|
11
|
+
date: 2024-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby2_keywords
|
@@ -132,7 +132,13 @@ homepage: https://mocha.jamesmead.org
|
|
132
132
|
licenses:
|
133
133
|
- MIT
|
134
134
|
- BSD-2-Clause
|
135
|
-
metadata:
|
135
|
+
metadata:
|
136
|
+
bug_tracker_uri: https://github.com/freerange/mocha/issues
|
137
|
+
changelog_uri: https://github.com/freerange/mocha/blob/main/RELEASE.md
|
138
|
+
documentation_uri: https://mocha.jamesmead.org/
|
139
|
+
funding_uri: https://github.com/sponsors/floehopper
|
140
|
+
homepage_uri: https://mocha.jamesmead.org
|
141
|
+
source_code_uri: https://github.com/freerange/mocha
|
136
142
|
post_install_message:
|
137
143
|
rdoc_options: []
|
138
144
|
require_paths:
|
@@ -148,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
154
|
- !ruby/object:Gem::Version
|
149
155
|
version: '0'
|
150
156
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
157
|
+
rubygems_version: 3.5.22
|
152
158
|
signing_key:
|
153
159
|
specification_version: 4
|
154
160
|
summary: Mocking and stubbing library
|