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 +4 -4
- data/interactor-rails.gemspec +1 -1
- data/lib/generators/interactor.rb +1 -1
- data/spec/interactor/rails_spec.rb +30 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ec2c715eab69b3fe8644ee34f4f82f8695bdb1b
|
4
|
+
data.tar.gz: 45ac618851888068d545e409e0e35a9db83dc178
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb469cab988835d2cefe431530f125319505f631af64498b17f4e739031830eb9ab76ba94d9e508a82c634400225bbdb1269dbb0b448752b7dc08ac814be8a0
|
7
|
+
data.tar.gz: ae19e48778fe71e121a76fd7b2fe1e6658fd0af5e6239a50b8b9b7537c39cb33923022889cafa38e84b2303fb93d3ae827d535149dca09a2ff349b7ede34a61a
|
data/interactor-rails.gemspec
CHANGED
@@ -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
|
|