mocha 1.10.0.alpha → 1.10.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/RELEASE.md +4 -0
- data/docs/Mocha.html +2 -2
- data/docs/Mocha/API.html +2 -2
- data/docs/Mocha/ClassMethods.html +2 -77
- data/docs/Mocha/Configuration.html +2 -2
- data/docs/Mocha/Expectation.html +2 -2
- data/docs/Mocha/ExpectationError.html +2 -2
- data/docs/Mocha/ExpectationErrorFactory.html +2 -2
- data/docs/Mocha/Hooks.html +2 -2
- data/docs/Mocha/Integration.html +2 -2
- data/docs/Mocha/Integration/MiniTest.html +2 -2
- data/docs/Mocha/Integration/MiniTest/Adapter.html +2 -2
- data/docs/Mocha/Integration/TestUnit.html +2 -2
- data/docs/Mocha/Integration/TestUnit/Adapter.html +2 -2
- data/docs/Mocha/Mock.html +2 -2
- data/docs/Mocha/ObjectMethods.html +2 -2
- data/docs/Mocha/ParameterMatchers.html +2 -2
- data/docs/Mocha/ParameterMatchers/AllOf.html +2 -2
- data/docs/Mocha/ParameterMatchers/AnyOf.html +2 -2
- data/docs/Mocha/ParameterMatchers/AnyParameters.html +2 -2
- data/docs/Mocha/ParameterMatchers/Anything.html +2 -2
- data/docs/Mocha/ParameterMatchers/Base.html +2 -2
- data/docs/Mocha/ParameterMatchers/Equals.html +2 -2
- data/docs/Mocha/ParameterMatchers/EquivalentUri.html +2 -2
- data/docs/Mocha/ParameterMatchers/HasEntries.html +2 -2
- data/docs/Mocha/ParameterMatchers/HasEntry.html +2 -2
- data/docs/Mocha/ParameterMatchers/HasKey.html +2 -2
- data/docs/Mocha/ParameterMatchers/HasValue.html +2 -2
- data/docs/Mocha/ParameterMatchers/Includes.html +2 -2
- data/docs/Mocha/ParameterMatchers/InstanceOf.html +2 -2
- data/docs/Mocha/ParameterMatchers/IsA.html +2 -2
- data/docs/Mocha/ParameterMatchers/KindOf.html +2 -2
- data/docs/Mocha/ParameterMatchers/Not.html +2 -2
- data/docs/Mocha/ParameterMatchers/Optionally.html +2 -2
- data/docs/Mocha/ParameterMatchers/RegexpMatches.html +2 -2
- data/docs/Mocha/ParameterMatchers/RespondsWith.html +2 -2
- data/docs/Mocha/ParameterMatchers/YamlEquivalent.html +2 -2
- data/docs/Mocha/Sequence.html +2 -2
- data/docs/Mocha/StateMachine.html +2 -2
- data/docs/Mocha/StateMachine/State.html +2 -2
- data/docs/Mocha/StateMachine/StatePredicate.html +2 -2
- data/docs/Mocha/StubbingError.html +2 -2
- data/docs/_index.html +3 -3
- data/docs/file.COPYING.html +2 -2
- data/docs/file.MIT-LICENSE.html +2 -2
- data/docs/file.README.html +2 -2
- data/docs/file.RELEASE.html +8 -2
- data/docs/frames.html +1 -1
- data/docs/index.html +2 -2
- data/docs/method_list.html +48 -56
- data/docs/top-level-namespace.html +2 -2
- data/lib/mocha/class_methods.rb +3 -2
- data/lib/mocha/mockery.rb +2 -2
- data/lib/mocha/stubbed_method.rb +2 -2
- data/lib/mocha/version.rb +1 -1
- metadata +2 -2
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Top Level Namespace
|
8
8
|
|
9
|
-
— Mocha 1.10.0.
|
9
|
+
— Mocha 1.10.0.beta.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -108,7 +108,7 @@
|
|
108
108
|
</div>
|
109
109
|
|
110
110
|
<div id="footer">
|
111
|
-
Generated on
|
111
|
+
Generated on Tue Nov 26 21:53:01 2019 by
|
112
112
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
113
113
|
0.9.20 (ruby-2.6.5).
|
114
114
|
</div>
|
data/lib/mocha/class_methods.rb
CHANGED
@@ -49,13 +49,14 @@ module Mocha
|
|
49
49
|
@any_instance ||= AnyInstance.new(self)
|
50
50
|
end
|
51
51
|
|
52
|
+
# @private
|
52
53
|
# rubocop:disable Metrics/CyclomaticComplexity
|
53
|
-
def
|
54
|
+
def __method_visibility__(method, include_public_methods = true)
|
54
55
|
(include_public_methods && public_method_defined?(method) && :public) ||
|
55
56
|
(protected_method_defined?(method) && :protected) ||
|
56
57
|
(private_method_defined?(method) && :private)
|
57
58
|
end
|
58
59
|
# rubocop:enable Metrics/CyclomaticComplexity
|
59
|
-
alias_method :
|
60
|
+
alias_method :__method_exists__?, :__method_visibility__
|
60
61
|
end
|
61
62
|
end
|
data/lib/mocha/mockery.rb
CHANGED
@@ -129,10 +129,10 @@ module Mocha
|
|
129
129
|
method = PRE_RUBY_V19 ? method.to_s : method.to_sym
|
130
130
|
method_signature = "#{object.mocha_inspect}.#{method}"
|
131
131
|
check(:stubbing_non_existent_method, 'non-existent method', method_signature) do
|
132
|
-
!(object.stubba_class.
|
132
|
+
!(object.stubba_class.__method_exists__?(method, true) || object.respond_to?(method.to_sym))
|
133
133
|
end
|
134
134
|
check(:stubbing_non_public_method, 'non-public method', method_signature) do
|
135
|
-
object.stubba_class.
|
135
|
+
object.stubba_class.__method_exists__?(method, false)
|
136
136
|
end
|
137
137
|
check(:stubbing_method_on_nil, 'method on nil', method_signature) { object.nil? }
|
138
138
|
check(:stubbing_method_on_non_mock_object, 'method on non-mock object', method_signature)
|
data/lib/mocha/stubbed_method.rb
CHANGED
@@ -36,7 +36,7 @@ module Mocha
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def hide_original_method
|
39
|
-
return unless original_method_owner.
|
39
|
+
return unless original_method_owner.__method_exists__?(method_name)
|
40
40
|
store_original_method_visibility
|
41
41
|
if use_prepended_module_for_stub_method?
|
42
42
|
use_prepended_module_for_stub_method
|
@@ -100,7 +100,7 @@ module Mocha
|
|
100
100
|
attr_reader :original_method, :original_visibility
|
101
101
|
|
102
102
|
def store_original_method_visibility
|
103
|
-
@original_visibility = original_method_owner.
|
103
|
+
@original_visibility = original_method_owner.__method_visibility__(method_name)
|
104
104
|
end
|
105
105
|
|
106
106
|
def stub_method_overwrites_original_method?
|
data/lib/mocha/version.rb
CHANGED
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.0.
|
4
|
+
version: 1.10.0.beta.1
|
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-11-
|
11
|
+
date: 2019-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|