rr 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +11 -0
- data/lib/rr/spy_verification.rb +13 -5
- data/lib/rr/spy_verification_proxy.rb +12 -5
- data/lib/rr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82a39c0be764a7469ef744b7d1ad4628b515e036013928623104e3876e70b01b
|
4
|
+
data.tar.gz: 78167900a5154d427ec6e0416f3ed740a79b92d3f24b85d4682acd34013b0f4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d07f274243be2338d218a19ff6ce448012875ad75f10eb9a29027b3a029b4541675d3cf92c4dd6cf5886a01abfb131ad39274a602c901f1cae9a04cf690cb0a2
|
7
|
+
data.tar.gz: febd48a6b12d689603d6f9ad9c31f97b034399b1227352b15acccd6d7b15f90496058f189c5290c0acb0510d35279656f06923f763da296cb539a5c3d682c332
|
data/CHANGES.md
CHANGED
data/lib/rr/spy_verification.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module RR
|
2
2
|
class SpyVerification
|
3
|
-
def initialize(subject, method_name, args)
|
3
|
+
def initialize(subject, method_name, args, kwargs)
|
4
4
|
@subject = subject
|
5
5
|
@method_name = method_name.to_sym
|
6
|
-
set_argument_expectation_for_args(args)
|
6
|
+
set_argument_expectation_for_args(args, kwargs)
|
7
7
|
@ordered = false
|
8
8
|
once
|
9
9
|
end
|
@@ -44,9 +44,17 @@ module RR
|
|
44
44
|
protected
|
45
45
|
attr_writer :times_matcher
|
46
46
|
|
47
|
-
def set_argument_expectation_for_args(args)
|
48
|
-
|
49
|
-
|
47
|
+
def set_argument_expectation_for_args(args, kwargs)
|
48
|
+
if args.empty? and kwargs.empty?
|
49
|
+
# with_no_args and with actually set @argument_expectation
|
50
|
+
with_no_args
|
51
|
+
else
|
52
|
+
if KeywordArguments.fully_supported?
|
53
|
+
with(*args, **kwargs)
|
54
|
+
else
|
55
|
+
with(*args)
|
56
|
+
end
|
57
|
+
end
|
50
58
|
end
|
51
59
|
|
52
60
|
def install_method_callback(return_value_block)
|
@@ -5,9 +5,16 @@ module RR
|
|
5
5
|
def initialize(subject)
|
6
6
|
@subject = subject
|
7
7
|
end
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
|
9
|
+
if KeywordArguments.fully_supported?
|
10
|
+
def method_missing(method_name, *args, **kwargs, &block)
|
11
|
+
SpyVerification.new(@subject, method_name, args, kwargs)
|
12
|
+
end
|
13
|
+
else
|
14
|
+
def method_missing(method_name, *args, &block)
|
15
|
+
SpyVerification.new(@subject, method_name, args, {})
|
16
|
+
end
|
17
|
+
ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
|
18
|
+
end
|
12
19
|
end
|
13
|
-
end
|
20
|
+
end
|
data/lib/rr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-06
|
13
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|