interactor-rails 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc95eb756f7d87176edac29d83a086e644dbdec4
4
- data.tar.gz: 47a07e8a9851ffdb09226eda2a908d4390540270
3
+ metadata.gz: 1ec2c715eab69b3fe8644ee34f4f82f8695bdb1b
4
+ data.tar.gz: 45ac618851888068d545e409e0e35a9db83dc178
5
5
  SHA512:
6
- metadata.gz: 281e21403dc891c3f655a15f3bc286d6e564e1fbda880c39924d23ae07564bac2bb1bc1f8a8f78a3a28dec32220962c6027262fc371c45c00c152f9997a99606
7
- data.tar.gz: d99ca17cd69765b2102af5dbcadc2ab86b96386fb085d89cecd46835d3d83676810c90f6bd27e73be4f11210e338ebf60b2dbd62e3793735c1d335e9380f6626
6
+ metadata.gz: ccb469cab988835d2cefe431530f125319505f631af64498b17f4e739031830eb9ab76ba94d9e508a82c634400225bbdb1269dbb0b448752b7dc08ac814be8a0
7
+ data.tar.gz: ae19e48778fe71e121a76fd7b2fe1e6658fd0af5e6239a50b8b9b7537c39cb33923022889cafa38e84b2303fb93d3ae827d535149dca09a2ff349b7ede34a61a
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "interactor-rails"
5
- spec.version = "2.0.0"
5
+ spec.version = "2.0.1"
6
6
 
7
7
  spec.author = "Collective Idea"
8
8
  spec.email = "info@collectiveidea.com"
@@ -5,7 +5,7 @@ module Interactor
5
5
  end
6
6
 
7
7
  def generate
8
- template "#{self.class.generator_name}.erb", "app/interactors/#{file_name}.rb"
8
+ template "#{self.class.generator_name}.erb", File.join("app/interactors", class_path, "#{file_name}.rb")
9
9
  end
10
10
  end
11
11
  end
@@ -47,6 +47,22 @@ EOF
47
47
  check_file_presence(["app/interactors/place_order.rb"], false)
48
48
  assert_partial_output("rails generate interactor NAME", all_stdout)
49
49
  end
50
+
51
+ it "handles namespacing" do
52
+ run_simple "bundle exec rails generate interactor invoice/place_order"
53
+
54
+ path = "app/interactors/invoice/place_order.rb"
55
+ check_file_presence([path], true)
56
+ check_exact_file_content(path, <<-EOF)
57
+ class Invoice::PlaceOrder
58
+ include Interactor
59
+
60
+ def call
61
+ # TODO
62
+ end
63
+ end
64
+ EOF
65
+ end
50
66
  end
51
67
 
52
68
  context "interactor:organizer" do
@@ -89,6 +105,20 @@ EOF
89
105
  check_file_presence(["app/interactors/place_order.rb"], false)
90
106
  assert_partial_output("rails generate interactor:organizer NAME", all_stdout)
91
107
  end
108
+
109
+ it "handles namespacing" do
110
+ run_simple "bundle exec rails generate interactor:organizer invoice/place_order"
111
+
112
+ path = "app/interactors/invoice/place_order.rb"
113
+ check_file_presence([path], true)
114
+ check_exact_file_content(path, <<-EOF)
115
+ class Invoice::PlaceOrder
116
+ include Interactor::Organizer
117
+
118
+ # organize Interactor1, Interactor2
119
+ end
120
+ EOF
121
+ end
92
122
  end
93
123
  end
94
124
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interactor-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Collective Idea