rspec-document_requests 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec/document_requests/request.rb +11 -13
- data/lib/rspec/document_requests/version.rb +1 -1
- 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: f229f7cf9a8e4fcb4d90515015a169d7960be159
|
4
|
+
data.tar.gz: c6d9c232d90e20e64e886dd7647bcd35f829cfce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b89fffd618c1105740a270287f23bc7bdeb9ef9b77c2557e12c097926af1a08f58f2a39cbf79539cbb72fcc7daf1a168d2f2001a7f419a960c7a0e3f7cb85cef
|
7
|
+
data.tar.gz: 763953cc2191e23a0fc1109c648682fb64f1700508ec83ee9a0657f87446278bfc63f425ccfb7cd20ea85835c95ba5b4dc9fb4bf4cbbdf5196725a53585ba5cf
|
@@ -92,24 +92,22 @@ module RSpec
|
|
92
92
|
|
93
93
|
def process_parameters(input, output, explanation:, prefix: nil)
|
94
94
|
input.each do |key, value|
|
95
|
-
|
95
|
+
key, value = nil, key if input.is_a?(Array)
|
96
|
+
if prefix
|
97
|
+
name = "#{prefix}[#{key}]"
|
98
|
+
else
|
99
|
+
name = input.is_a?(Array) ? "[]" : key.to_s
|
100
|
+
end
|
96
101
|
case value
|
97
102
|
when Hash
|
98
103
|
process_parameters(value, output, explanation: explanation, prefix: name)
|
99
104
|
when Array
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
when Hash
|
105
|
-
process_parameters(subvalue, output, explanation: explanation, prefix: name)
|
106
|
-
else
|
107
|
-
base_values << subvalue
|
108
|
-
end
|
109
|
-
end
|
110
|
-
if base_values.any?
|
105
|
+
if value.all? { |subvalue| subvalue.is_a?(Hash) }
|
106
|
+
process_parameters(value, output, explanation: explanation, prefix: name)
|
107
|
+
else
|
108
|
+
name += "[]"
|
111
109
|
output[name] ||= explanation[name] || Parameter.new(generated: true)
|
112
|
-
output[name].value = [output[name].value,
|
110
|
+
output[name].value = [output[name].value, value.to_s].compact.join(", ")
|
113
111
|
end
|
114
112
|
else
|
115
113
|
output[name] ||= explanation[name] || Parameter.new(generated: true)
|