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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48ae4cdc95136e2d4634abb54b9af7ab13816df90cb147c39bc59d7948f470cf
4
- data.tar.gz: 4361edbf7cfc0d182c3a4efa2f0a98f7ed76cbc5283976e4cf7ff1019cc67021
3
+ metadata.gz: 5281abc2705c0b4a4b4df43058e28534c06b5e340dc4e6a246ef0f1558aa6927
4
+ data.tar.gz: be879db3848729be75fb39497950bb290ff5aa20a42471b1c47d2400a301374b
5
5
  SHA512:
6
- metadata.gz: 1782e56969744186ba4edd1f0f14dcbc182897c4a4e087866c01110e643e33fc4d9f16cfc2e080420584fce1da0426032ddd415a140921f0cbc4301817d68ef9
7
- data.tar.gz: d462d0249546d8eb8b4da751bd35b223db77b38e10194a3f40912ec8464de2e979863e09450ac022cf8ea732a6e156bf6dacb5be2ec94311169bb54e467f146e
6
+ metadata.gz: 9796a8c8e98ede7c50f0c126e20f06a28d1b797b37868275fcdd82bad66636dc7320f487b3165250fd27d6482189442c629dd46a09dc44e28aa238c6ed7fd850
7
+ data.tar.gz: 6a4fed719d00690a75c603dd089a7e438eb4d3117479f60a3bd40912b7caa2bd6978e3a8c2ed0c9f6c3f1752bc901e24bbcf9492b4fac859e2d67a911f947737
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- interactor-initializer (1.0.1)
4
+ interactor-initializer (1.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'interactor/initializer/version'
@@ -1,5 +1,5 @@
1
1
  module Interactor
2
2
  module Initializer
3
- VERSION = '1.0.1'.freeze
3
+ VERSION = '1.1.0'.freeze
4
4
  end
5
5
  end
@@ -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.1
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-03-22 00:00:00.000000000 Z
11
+ date: 2022-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler