interactor_with_steroids 1.2.0 → 1.3.0
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/interactor.gemspec +1 -1
- data/lib/interactor/error.rb +7 -0
- data/spec/interactor/error_spec.rb +29 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c29f3d44762d497592a20ae9da8a448fbdf2121116fc5c222f6323e1352c98e
|
4
|
+
data.tar.gz: b6f0cca693608e9c8cfecd0dd51098c9befb29ef26395e8750c9fd0ffd253699
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 761a11f3eaead34c27ce5df13af3f17449d3b7317da05d77efd3091debfa1b249b2db8a5759ed189470f3f16e0aff25a70f8ac84d4b788d7ab06a08f2f1c7927
|
7
|
+
data.tar.gz: '039491509364e1df4dfb16084b782d8be7983900da3a15120001f811f68509a33656d376aa388ea279530ab2b7e17e5f3ebd704f158a98b17e3e877f5e9dd91c'
|
data/interactor.gemspec
CHANGED
data/lib/interactor/error.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
module Interactor
|
2
|
+
describe Failure do
|
3
|
+
describe ".cause_stack" do
|
4
|
+
subject { failure.cause_stack }
|
5
|
+
|
6
|
+
let(:exception_1) { Class.new(Exception) }
|
7
|
+
let(:exception_2) { Class.new(Exception) }
|
8
|
+
let(:interactor) do
|
9
|
+
Class.new.send(:include, Interactor) do
|
10
|
+
def call
|
11
|
+
begin
|
12
|
+
raise exception_1
|
13
|
+
rescue StandardError
|
14
|
+
raise exception_2
|
15
|
+
end
|
16
|
+
rescue StandardError
|
17
|
+
context.fail!
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
it "returns an empty stack" do
|
23
|
+
interactor.call!
|
24
|
+
rescue Failure => e
|
25
|
+
expect(e.cause_stack).to contain_exactly(described_class, exception_1, exception_2)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interactor_with_steroids
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Collective Idea/Sorare Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- lib/interactor/organizer.rb
|
78
78
|
- spec/interactor/context_spec.rb
|
79
79
|
- spec/interactor/declaration_spec.rb
|
80
|
+
- spec/interactor/error_spec.rb
|
80
81
|
- spec/interactor/hooks_spec.rb
|
81
82
|
- spec/interactor/organizer_spec.rb
|
82
83
|
- spec/interactor_spec.rb
|
@@ -107,6 +108,7 @@ summary: Simple interactor implementation
|
|
107
108
|
test_files:
|
108
109
|
- spec/interactor/context_spec.rb
|
109
110
|
- spec/interactor/declaration_spec.rb
|
111
|
+
- spec/interactor/error_spec.rb
|
110
112
|
- spec/interactor/hooks_spec.rb
|
111
113
|
- spec/interactor/organizer_spec.rb
|
112
114
|
- spec/interactor_spec.rb
|