servactory 2.9.0.rc7 → 2.9.0.rc8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/servactory/test_kit/rspec/helpers.rb +24 -15
- data/lib/servactory/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: cbd8f1aab15e1cfd99b746c96f357f075b15e494490ea4bcae946545b76b5e5b
|
4
|
+
data.tar.gz: 896768b2f5b685940ca50d40914a3ab5059f11c35d6b4d284daf2ca4e6cdfc17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ee297769b7a30216bb9e3cde31701a3660090cd3229510de6f632a5c350e007e90ff6c8920168d181a7551a101443e7c17e19c5858c8d16c814f31a74c27b15
|
7
|
+
data.tar.gz: c5a5ff1006fe27c33651546e6b42eb7e936dcbaacfb96034eeaa65f20800e43e1c17fe4317f26100864ebec51cdc9089e77114673f61cf8720ae614883aa7f88
|
@@ -4,36 +4,36 @@ module Servactory
|
|
4
4
|
module TestKit
|
5
5
|
module Rspec
|
6
6
|
module Helpers
|
7
|
-
def allow_service_as_success!(
|
8
|
-
allow_service!(
|
7
|
+
def allow_service_as_success!(service_class, with: nil, &block)
|
8
|
+
allow_service!(service_class, :as_success, with:, &block)
|
9
9
|
end
|
10
10
|
|
11
|
-
def allow_service_as_success(
|
12
|
-
allow_service(
|
11
|
+
def allow_service_as_success(service_class, with: nil, &block)
|
12
|
+
allow_service(service_class, :as_success, with:, &block)
|
13
13
|
end
|
14
14
|
|
15
|
-
def allow_service_as_failure!(
|
16
|
-
allow_service!(
|
15
|
+
def allow_service_as_failure!(service_class, with: nil, &block)
|
16
|
+
allow_service!(service_class, :as_failure, with:, &block)
|
17
17
|
end
|
18
18
|
|
19
|
-
def allow_service_as_failure(
|
20
|
-
allow_service(
|
19
|
+
def allow_service_as_failure(service_class, with: nil, &block)
|
20
|
+
allow_service(service_class, :as_failure, with:, &block)
|
21
21
|
end
|
22
22
|
|
23
23
|
########################################################################
|
24
24
|
|
25
|
-
def allow_service!(
|
26
|
-
allow_servactory(
|
25
|
+
def allow_service!(service_class, result_type, with: nil, &block)
|
26
|
+
allow_servactory(service_class, :call!, result_type, with:, &block)
|
27
27
|
end
|
28
28
|
|
29
|
-
def allow_service(
|
30
|
-
allow_servactory(
|
29
|
+
def allow_service(service_class, result_type, with: nil, &block)
|
30
|
+
allow_servactory(service_class, :call, result_type, with:, &block)
|
31
31
|
end
|
32
32
|
|
33
33
|
########################################################################
|
34
34
|
|
35
35
|
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
36
|
-
def allow_servactory(
|
36
|
+
def allow_servactory(service_class, method_call, result_type, with: nil)
|
37
37
|
method_call = method_call.to_sym
|
38
38
|
result_type = result_type.to_sym
|
39
39
|
|
@@ -66,7 +66,7 @@ module Servactory
|
|
66
66
|
|
67
67
|
# puts
|
68
68
|
# puts <<~RUBY
|
69
|
-
# allow(#{
|
69
|
+
# allow(#{service_class}).to(
|
70
70
|
# receive(#{method_call.inspect})
|
71
71
|
# .public_send(
|
72
72
|
# #{and_return_or_raise.inspect},
|
@@ -76,8 +76,17 @@ module Servactory
|
|
76
76
|
# RUBY
|
77
77
|
# puts
|
78
78
|
|
79
|
-
allow(
|
79
|
+
allow(service_class).to(
|
80
80
|
receive(method_call)
|
81
|
+
.with(
|
82
|
+
if with.present?
|
83
|
+
with
|
84
|
+
elsif (input_names = service_class.info.inputs.keys).present?
|
85
|
+
input_names.to_h { |input_name| [input_name, anything] }
|
86
|
+
else
|
87
|
+
no_args
|
88
|
+
end
|
89
|
+
)
|
81
90
|
.public_send(
|
82
91
|
and_return_or_raise,
|
83
92
|
if as_success
|
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.rc8
|
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-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|