servactory 2.9.0.rc5 → 2.9.0.rc7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/servactory/test_kit/rspec/matchers.rb +21 -9
- data/lib/servactory/version.rb +1 -1
- metadata +44 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc0459a342f5c414049d7076a5528caffde75708da4db7dfbf87fe1fe391d9c1
|
4
|
+
data.tar.gz: b7c803517e06af791bd0fa3d3807b802b404603a1d0f7555d72349e5341c55c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9cf3ac1cc28007ab25711d1586f8ebfecc513f73858eec2cf46f7f3c9ff2f7a18b0a2d5ddb313ef111c00433194fb563158bb659b93a38fa97ae0e5e6ac9246
|
7
|
+
data.tar.gz: b76e44154fb22358c0b10d8c80909430d74d524c3a7a6013a669e2279244d9343d31007cc67a7d702284650f805a837f9f97a714abf6d9dc3de2f42854848199
|
@@ -38,7 +38,7 @@ module Servactory
|
|
38
38
|
@nested = values
|
39
39
|
end
|
40
40
|
|
41
|
-
chain :
|
41
|
+
chain :contains do |value|
|
42
42
|
@value = value
|
43
43
|
end
|
44
44
|
|
@@ -50,6 +50,12 @@ module Servactory
|
|
50
50
|
def match_for(actual, output_name)
|
51
51
|
given_value = actual.public_send(output_name)
|
52
52
|
|
53
|
+
if defined?(@instance_of)
|
54
|
+
expect(given_value).to(
|
55
|
+
RSpec::Matchers::BuiltIn::BeAnInstanceOf.new(@instance_of)
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
53
59
|
if defined?(@nested) && @nested.present?
|
54
60
|
@nested.each do |method_name|
|
55
61
|
next unless given_value.respond_to?(method_name)
|
@@ -58,16 +64,17 @@ module Servactory
|
|
58
64
|
end
|
59
65
|
end
|
60
66
|
|
67
|
+
return true if !defined?(@value) && @value.nil?
|
68
|
+
|
61
69
|
expect(given_value).to(
|
62
|
-
|
63
|
-
|
64
|
-
elsif @value.is_a?(Array)
|
70
|
+
case @value
|
71
|
+
when Array
|
65
72
|
RSpec::Matchers::BuiltIn::ContainExactly.new(@value)
|
66
|
-
|
73
|
+
when Hash
|
67
74
|
RSpec::Matchers::BuiltIn::Match.new(@value)
|
68
|
-
|
75
|
+
when TrueClass, FalseClass
|
69
76
|
RSpec::Matchers::BuiltIn::Equal.new(@value)
|
70
|
-
|
77
|
+
when NilClass
|
71
78
|
RSpec::Matchers::BuiltIn::BeNil.new(@value)
|
72
79
|
else
|
73
80
|
RSpec::Matchers::BuiltIn::Eq.new(@value)
|
@@ -186,8 +193,8 @@ module Servactory
|
|
186
193
|
matched &&= actual.error.is_a?(Servactory::Exceptions::Failure)
|
187
194
|
matched &&= actual.error.is_a?(expected_failure_class)
|
188
195
|
matched &&= actual.error.type == expected_type
|
189
|
-
matched &&= actual.error.message == expected_message
|
190
|
-
matched &&= actual.error.meta == expected_meta
|
196
|
+
matched &&= actual.error.message == expected_message if defined?(@expected_message)
|
197
|
+
matched &&= actual.error.meta == expected_meta if defined?(@expected_meta)
|
191
198
|
matched
|
192
199
|
end
|
193
200
|
|
@@ -285,6 +292,11 @@ module Servactory
|
|
285
292
|
<<~MESSAGE
|
286
293
|
Unexpected case when using `be_failure_service`.
|
287
294
|
|
295
|
+
Exception: #{actual.error.inspect}
|
296
|
+
Type: #{actual.error.type.inspect}
|
297
|
+
Message: #{actual.error.message.inspect}
|
298
|
+
Meta: #{actual.error.meta.inspect}
|
299
|
+
|
288
300
|
Please try to build an example based on the documentation.
|
289
301
|
Or report your problem to us:
|
290
302
|
|
data/lib/servactory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.0.
|
4
|
+
version: 2.9.0.rc7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,6 +30,34 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '8.1'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: base64
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.2'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.2'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bigdecimal
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.0'
|
33
61
|
- !ruby/object:Gem::Dependency
|
34
62
|
name: i18n
|
35
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,6 +72,20 @@ dependencies:
|
|
44
72
|
- - "~>"
|
45
73
|
- !ruby/object:Gem::Version
|
46
74
|
version: '1.14'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: mutex_m
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0.2'
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0.2'
|
47
89
|
- !ruby/object:Gem::Dependency
|
48
90
|
name: zeitwerk
|
49
91
|
requirement: !ruby/object:Gem::Requirement
|