souls 0.30.5 → 0.30.9
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/lib/souls/api/generate/rspec_mutation.rb +10 -2
- data/lib/souls/api/generate/rspec_resolver.rb +10 -2
- data/lib/souls/api/update/resolver.rb +2 -0
- data/lib/souls/api/update/rspec_factory.rb +2 -0
- data/lib/souls/api/update/rspec_mutation.rb +9 -6
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f0f0cd6d520941962959bc7639c20ab07d701a37f95bcc47834f5a714c3ec3c
|
4
|
+
data.tar.gz: 61b2b8f0290548229391880a915aa90b756760acb51a8b72461d51dcb7d2f636
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9b4126cf1c69be736cfae30d67b85bd9a254911b884b16ddabbb33e7e4c82aa6783e4862bdae984dbe5d5ccd1ee68e7d352e0efb2aae562eae22a8b15feb6d5
|
7
|
+
data.tar.gz: 223dc66153880ebe293fab5d1e14e1b32d1c76635467352477396c9e056c5f37eb55f0fbc42060f7d0ed82cbeb91df732062ec65973f234061877afeb1d61b0a
|
@@ -230,9 +230,17 @@ module Souls
|
|
230
230
|
new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(String),\n")
|
231
231
|
end
|
232
232
|
when "boolean"
|
233
|
-
|
233
|
+
if array_true
|
234
|
+
new_line.write(" \"#{name.pluralize.camelize(:lower)}\" => be_all([true, false]),\n")
|
235
|
+
else
|
236
|
+
new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_in([true, false]),\n")
|
237
|
+
end
|
234
238
|
when "string", "bigint", "integer", "float"
|
235
|
-
|
239
|
+
if array_true
|
240
|
+
new_line.write(" \"#{name.pluralize.camelize(:lower)}\" => be_all(#{field}),\n")
|
241
|
+
else
|
242
|
+
new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(#{field}),\n")
|
243
|
+
end
|
236
244
|
end
|
237
245
|
end
|
238
246
|
end
|
@@ -157,9 +157,17 @@ module Souls
|
|
157
157
|
new_line.write(" \"#{name.camelize(:lower)}\" => be_a(String),\n")
|
158
158
|
end
|
159
159
|
when "boolean"
|
160
|
-
|
160
|
+
if array_true
|
161
|
+
new_line.write(" \"#{name.camelize(:lower)}\" => be_all([true, false]),\n")
|
162
|
+
else
|
163
|
+
new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_in([true, false]),\n")
|
164
|
+
end
|
161
165
|
when "string", "bigint", "integer", "float"
|
162
|
-
|
166
|
+
if array_true
|
167
|
+
new_line.write(" \"#{name.camelize(:lower)}\" => be_all(#{field}),\n")
|
168
|
+
else
|
169
|
+
new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(#{field}),\n")
|
170
|
+
end
|
163
171
|
end
|
164
172
|
end
|
165
173
|
end
|
@@ -44,6 +44,8 @@ module Souls
|
|
44
44
|
FileUtils.rm(file_path)
|
45
45
|
FileUtils.mv(new_file_path, file_path)
|
46
46
|
puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
47
|
+
rescue StandardError => e
|
48
|
+
p(e.backtrace)
|
47
49
|
end
|
48
50
|
|
49
51
|
def check_resolver_argument(class_name: "user", action: "argument")
|
@@ -17,6 +17,8 @@ module Souls
|
|
17
17
|
next unless line.include?("{") && !argument
|
18
18
|
|
19
19
|
new_cols.each do |col|
|
20
|
+
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
21
|
+
|
20
22
|
type = Souls::Api::Generate.get_test_type(col[:type])
|
21
23
|
type = "[#{type}]" if col[:array]
|
22
24
|
args = check_factory_argument(class_name: class_name)
|
@@ -23,13 +23,16 @@ module Souls
|
|
23
23
|
if line.include?('#{') && !argument
|
24
24
|
new_cols.each do |col|
|
25
25
|
type = Souls::Api::Generate.type_check(col[:type])
|
26
|
-
if
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
27
|
+
|
28
|
+
type_line =
|
29
|
+
if type == "String" && !col[:array]
|
30
|
+
" #{col[:column_name].camelize(:lower)}: \"\#{#{class_name}[:#{col[:column_name].underscore}]}\"\n"
|
31
|
+
else
|
32
|
+
" #{col[:column_name].camelize(:lower)}: \#{#{class_name}[:#{col[:column_name].underscore}]}\n"
|
33
|
+
end
|
31
34
|
args = check_rspec_mutation_argument(class_name: class_name)
|
32
|
-
new_line.write(type_line) unless args.include?(col[:column_name].
|
35
|
+
new_line.write(type_line) unless args.include?(col[:column_name].underscore)
|
33
36
|
end
|
34
37
|
argument = true
|
35
38
|
elsif node_res && !line.include?("{")
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.9
|
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.9
|