rspec-mocks 3.7.0 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +14 -3
- data/README.md +1 -1
- data/lib/rspec/mocks/any_instance/recorder.rb +1 -1
- data/lib/rspec/mocks/any_instance/stub_chain.rb +2 -2
- data/lib/rspec/mocks/error_generator.rb +2 -2
- data/lib/rspec/mocks/matchers/have_received.rb +4 -0
- data/lib/rspec/mocks/message_expectation.rb +4 -3
- data/lib/rspec/mocks/method_reference.rb +8 -8
- data/lib/rspec/mocks/proxy.rb +1 -0
- data/lib/rspec/mocks/test_double.rb +1 -1
- data/lib/rspec/mocks/version.rb +1 -1
- metadata +6 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20312b11c0d1afe102fb10eece7ff42580873332
|
4
|
+
data.tar.gz: '09febe88bdf3e5548b4aa472cc86163597a51049'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25e25343ed7f1ecf2a913298c0ef36146bc6934a0d3b73eaccdc4e0645f369ec7e61dd59f811cb6bff4499d94682862e1d8ad8d56ea88f94dfa63b57dded7907
|
7
|
+
data.tar.gz: 94cd883965c37989c5b0542c36e955cbb6fbd4ba94b7513326aaa14679966a5bb96449b6e7bc0deda51a77e13411fc9ee33c10c9bc25f73d2bed61770463c4c8
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
|
-
### 3.8
|
2
|
-
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.7.0...
|
1
|
+
### 3.8.0 / 2018-08-04
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.7.0...v3.8.0)
|
3
|
+
|
4
|
+
Bug Fixes:
|
5
|
+
|
6
|
+
* Issue error when encountering invalid "counted" negative message expectations.
|
7
|
+
(Sergiy Yarinovskiy, #1212)
|
8
|
+
* Ensure `allow_any_instance_of` and `expect_any_instance_of` can be temporarily
|
9
|
+
supressed. (Jon Rowe, #1228)
|
10
|
+
* Ensure `expect_any_instance_of(double).to_not have_received(:some_method)`
|
11
|
+
fails gracefully (as its not supported) rather than issuing a `NoMethodError`.
|
12
|
+
(Maxim Krizhanovsky, #1231)
|
3
13
|
|
4
14
|
### 3.7.0 / 2017-10-17
|
5
15
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v3.6.0...v3.7.0)
|
@@ -896,7 +906,8 @@ Bug fixes
|
|
896
906
|
* Fix `should_receive` so that when it is called on an `as_null_object`
|
897
907
|
double with no implementation, and there is a previous explicit stub
|
898
908
|
for the same method, the explicit stub remains (rather than being
|
899
|
-
|
909
|
+
overridden with the null object implementation--`return self`). (Myron
|
910
|
+
Marston)
|
900
911
|
|
901
912
|
### 2.11.0 / 2012-07-07
|
902
913
|
[Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.10.1...v2.11.0)
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ RSpec repos as well. Add the following to your `Gemfile`:
|
|
13
13
|
|
14
14
|
```ruby
|
15
15
|
%w[rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib|
|
16
|
-
gem lib, :git => "
|
16
|
+
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => 'master'
|
17
17
|
end
|
18
18
|
```
|
19
19
|
## Contributing
|
@@ -242,7 +242,7 @@ module RSpec
|
|
242
242
|
def observe!(method_name)
|
243
243
|
allow_no_prepended_module_definition_of(method_name)
|
244
244
|
|
245
|
-
if RSpec::Mocks.configuration.verify_partial_doubles?
|
245
|
+
if RSpec::Mocks.configuration.verify_partial_doubles? && !Mocks.configuration.temporarily_suppress_partial_double_verification
|
246
246
|
unless public_protected_or_private_method_defined?(method_name)
|
247
247
|
AnyInstance.error_generator.raise_does_not_implement_error(@klass, method_name)
|
248
248
|
end
|
@@ -25,7 +25,7 @@ module RSpec
|
|
25
25
|
stub
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
InvocationOrder =
|
29
29
|
{
|
30
30
|
:and_return => [:with, nil],
|
31
31
|
:and_raise => [:with, nil],
|
@@ -38,7 +38,7 @@ module RSpec
|
|
38
38
|
EmptyInvocationOrder = {}.freeze
|
39
39
|
|
40
40
|
def invocation_order
|
41
|
-
|
41
|
+
InvocationOrder
|
42
42
|
end
|
43
43
|
|
44
44
|
def verify_invocation_order(rspec_method_name, *_args, &_block)
|
@@ -72,7 +72,7 @@ module RSpec
|
|
72
72
|
"#{intro} received #{expectation.message.inspect} #{unexpected_arguments_message(expected_args, actual_args)}".dup
|
73
73
|
end
|
74
74
|
|
75
|
-
# rubocop:disable
|
75
|
+
# rubocop:disable Metrics/ParameterLists
|
76
76
|
# @private
|
77
77
|
def raise_expectation_error(message, expected_received_count, argument_list_matcher,
|
78
78
|
actual_received_count, expectation_count_type, args,
|
@@ -81,7 +81,7 @@ module RSpec
|
|
81
81
|
received_part = received_part_of_expectation_error(actual_received_count, args)
|
82
82
|
__raise "(#{intro(:unwrapped)}).#{message}#{format_args(args)}\n #{expected_part}\n #{received_part}", backtrace_line, source_id
|
83
83
|
end
|
84
|
-
# rubocop:enable
|
84
|
+
# rubocop:enable Metrics/ParameterLists
|
85
85
|
|
86
86
|
# @private
|
87
87
|
def raise_unimplemented_error(doubled_module, method_name, object)
|
@@ -367,7 +367,7 @@ module RSpec
|
|
367
367
|
# @private
|
368
368
|
attr_reader :type
|
369
369
|
|
370
|
-
# rubocop:disable
|
370
|
+
# rubocop:disable Metrics/ParameterLists
|
371
371
|
def initialize(error_generator, expectation_ordering, expected_from, method_double,
|
372
372
|
type=:expectation, opts={}, &implementation_block)
|
373
373
|
@type = type
|
@@ -395,7 +395,7 @@ module RSpec
|
|
395
395
|
@implementation = Implementation.new
|
396
396
|
self.inner_implementation_action = implementation_block
|
397
397
|
end
|
398
|
-
# rubocop:enable
|
398
|
+
# rubocop:enable Metrics/ParameterLists
|
399
399
|
|
400
400
|
def expected_args
|
401
401
|
@argument_list_matcher.expected_args
|
@@ -581,6 +581,7 @@ module RSpec
|
|
581
581
|
end
|
582
582
|
|
583
583
|
def set_expected_received_count(relativity, n)
|
584
|
+
raise "`count` is not supported with negative message expectations" if negative?
|
584
585
|
@at_least = (relativity == :at_least)
|
585
586
|
@at_most = (relativity == :at_most)
|
586
587
|
@exactly = (relativity == :exactly)
|
@@ -650,7 +651,7 @@ module RSpec
|
|
650
651
|
@error_generator.raise_wrong_arity_error(args, block_signature)
|
651
652
|
end
|
652
653
|
|
653
|
-
value = @eval_context ? @eval_context.instance_exec(*args, &block) :
|
654
|
+
value = @eval_context ? @eval_context.instance_exec(*args, &block) : yield(*args)
|
654
655
|
end
|
655
656
|
value
|
656
657
|
end
|
@@ -64,14 +64,6 @@ module RSpec
|
|
64
64
|
:public
|
65
65
|
end
|
66
66
|
|
67
|
-
private
|
68
|
-
|
69
|
-
def original_method
|
70
|
-
@object_reference.when_loaded do |m|
|
71
|
-
self.defined? && find_method(m)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
67
|
def self.instance_method_visibility_for(klass, method_name)
|
76
68
|
if klass.public_method_defined?(method_name)
|
77
69
|
:public
|
@@ -107,6 +99,14 @@ module RSpec
|
|
107
99
|
|
108
100
|
return :public if visible
|
109
101
|
end
|
102
|
+
|
103
|
+
private
|
104
|
+
|
105
|
+
def original_method
|
106
|
+
@object_reference.when_loaded do |m|
|
107
|
+
self.defined? && find_method(m)
|
108
|
+
end
|
109
|
+
end
|
110
110
|
end
|
111
111
|
|
112
112
|
# @private
|
data/lib/rspec/mocks/proxy.rb
CHANGED
data/lib/rspec/mocks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -45,7 +45,7 @@ cert_chain:
|
|
45
45
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
46
46
|
F3MdtaDehhjC
|
47
47
|
-----END CERTIFICATE-----
|
48
|
-
date:
|
48
|
+
date: 2018-08-04 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
@@ -53,14 +53,14 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 3.
|
56
|
+
version: 3.8.0
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 3.
|
63
|
+
version: 3.8.0
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: diff-lcs
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -210,9 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
212
|
rubyforge_project:
|
213
|
-
rubygems_version: 2.6.
|
213
|
+
rubygems_version: 2.6.13
|
214
214
|
signing_key:
|
215
215
|
specification_version: 4
|
216
|
-
summary: rspec-mocks-3.
|
216
|
+
summary: rspec-mocks-3.8.0
|
217
217
|
test_files: []
|
218
|
-
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|