rr 3.0.5 → 3.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +40 -0
- data/Gemfile +7 -0
- data/lib/rr/integrations/minitest_4.rb +12 -1
- data/lib/rr/keyword_arguments.rb +1 -1
- 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: 1053e9c05c201e89415c92c0751d397aeb0cf54c122156b572f92b882ffa24a8
|
4
|
+
data.tar.gz: 197c473a885192c537f2d3eb68aa8e0efb8b3f4a88e089385cf396c7433c214e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e90a367b42a7a0a4ef9d68296c0ffa65450b16b2bceb04347210ae15796b90857e42ae3c960a7720808e6cf3172320d985357096ec334aa42b435c98b6ef691
|
7
|
+
data.tar.gz: 856409966ac4f007b3f397c729978b8547c12f924aac17d92d30fc830f1fd6bb0266d228c772cf750aaffae20b3102deb84a7b77a37fc14cafedd2a63d2a2e64
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,45 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.0.9 - 2021-12-07
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Marked TruffleRuby as "keyword arguments aren't fully supported yet".
|
8
|
+
|
9
|
+
## 3.0.8 - 2021-10-17
|
10
|
+
|
11
|
+
### Fixes
|
12
|
+
|
13
|
+
* Minitest integration: Fixed a bug that `NameError` is raised.
|
14
|
+
[GitHub#88][Reported by Matijs van Zuijlen]
|
15
|
+
|
16
|
+
### Thanks
|
17
|
+
|
18
|
+
* Matijs van Zuijlen
|
19
|
+
|
20
|
+
## 3.0.7 - 2021-08-17
|
21
|
+
|
22
|
+
### Fixes
|
23
|
+
|
24
|
+
* Minitest + Active Support integration: Fixed a bug that `stub` in
|
25
|
+
`setup {...}` is ignored.
|
26
|
+
[GitHub#87][Reported by Boris]
|
27
|
+
|
28
|
+
### Thanks
|
29
|
+
|
30
|
+
* Boris
|
31
|
+
|
32
|
+
## 3.0.6 - 2021-08-07
|
33
|
+
|
34
|
+
### Improvements
|
35
|
+
|
36
|
+
* `assert_received`: Added support for keyword arguments.
|
37
|
+
[GitHub#86][Reported by imadoki]
|
38
|
+
|
39
|
+
### Thanks
|
40
|
+
|
41
|
+
* imadoki
|
42
|
+
|
3
43
|
## 3.0.5 - 2021-06-26
|
4
44
|
|
5
45
|
### Improvements
|
data/Gemfile
CHANGED
@@ -39,10 +39,21 @@ module RR
|
|
39
39
|
include RR::DSL
|
40
40
|
include Mixin
|
41
41
|
|
42
|
+
if defined?(::ActiveSupport::TestCase)
|
43
|
+
is_active_support_test_case = lambda do |target|
|
44
|
+
target.is_a?(::ActiveSupport::TestCase)
|
45
|
+
end
|
46
|
+
else
|
47
|
+
is_active_support_test_case = lambda do |target|
|
48
|
+
false
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
42
52
|
unless instance_methods.any? { |method_name| method_name.to_sym == :setup_with_rr }
|
43
53
|
alias_method :setup_without_rr, :setup
|
44
54
|
define_method(:setup_with_rr) do
|
45
55
|
setup_without_rr
|
56
|
+
return if is_active_support_test_case.call(self)
|
46
57
|
RR.reset
|
47
58
|
RR.trim_backtrace = true
|
48
59
|
RR.overridden_error_class = assertion_error_class
|
@@ -52,7 +63,7 @@ module RR
|
|
52
63
|
alias_method :teardown_without_rr, :teardown
|
53
64
|
define_method(:teardown_with_rr) do
|
54
65
|
begin
|
55
|
-
RR.verify
|
66
|
+
RR.verify unless is_active_support_test_case.call(self)
|
56
67
|
ensure
|
57
68
|
teardown_without_rr
|
58
69
|
end
|
data/lib/rr/keyword_arguments.rb
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.9
|
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-
|
13
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|