interactor-initializer 1.0.1 → 1.1.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/Gemfile.lock +1 -1
- data/interactor-initializer.gemspec +1 -0
- data/lib/interactor/initializer/version.rb +1 -1
- data/lib/interactor/initializer.rb +3 -0
- data/spec/interactor/initializer_spec.rb +48 -0
- 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: 5281abc2705c0b4a4b4df43058e28534c06b5e340dc4e6a246ef0f1558aa6927
|
4
|
+
data.tar.gz: be879db3848729be75fb39497950bb290ff5aa20a42471b1c47d2400a301374b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9796a8c8e98ede7c50f0c126e20f06a28d1b797b37868275fcdd82bad66636dc7320f487b3165250fd27d6482189442c629dd46a09dc44e28aa238c6ed7fd850
|
7
|
+
data.tar.gz: 6a4fed719d00690a75c603dd089a7e438eb4d3117479f60a3bd40912b7caa2bd6978e3a8c2ed0c9f6c3f1752bc901e24bbcf9492b4fac859e2d67a911f947737
|
data/Gemfile.lock
CHANGED
@@ -7,6 +7,9 @@ module Interactor
|
|
7
7
|
module Initializer
|
8
8
|
def self.included(target_class)
|
9
9
|
target_class.extend ClassMethods
|
10
|
+
|
11
|
+
class_methods = Interactor::Initializer::Helper.methods_with_params
|
12
|
+
Interactor::Initializer::Helper.modify_class(target_class, '', [], class_methods)
|
10
13
|
end
|
11
14
|
|
12
15
|
module ClassMethods
|
@@ -106,4 +106,52 @@ describe Interactor::Initializer do
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
109
|
+
|
110
|
+
context 'with bare inclusion' do
|
111
|
+
let(:interactor) do
|
112
|
+
Class.new do
|
113
|
+
include Interactor::Initializer
|
114
|
+
|
115
|
+
def run
|
116
|
+
:result
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe '.run' do
|
122
|
+
subject { interactor.run }
|
123
|
+
|
124
|
+
it { is_expected.to eq(:result) }
|
125
|
+
end
|
126
|
+
|
127
|
+
describe '.for' do
|
128
|
+
subject { interactor.for }
|
129
|
+
|
130
|
+
it { is_expected.to eq(:result) }
|
131
|
+
end
|
132
|
+
|
133
|
+
describe '.with' do
|
134
|
+
subject { interactor.with }
|
135
|
+
|
136
|
+
it { is_expected.to eq(:result) }
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'when class is not including interactor initializer' do
|
140
|
+
let(:interactor) do
|
141
|
+
Class.new do
|
142
|
+
def run
|
143
|
+
:result
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe '.run' do
|
149
|
+
subject { interactor.run }
|
150
|
+
|
151
|
+
it 'cannot call interactor' do
|
152
|
+
expect { subject }.to raise_error(/undefined method/)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
109
157
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interactor-initializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Šarūnas Kūjalis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|