rspec-document_requests 1.0.1 → 1.1.0
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 +21 -5
- 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: 231e877c797beff56b6713d86e7247cf7e31ea72
|
4
|
+
data.tar.gz: 06f5cbf0269fa7c3d5f772425081619327ef7ab7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efc0c7d69098f85741a3cbc27e395e6addb62510226ac4398a4c27e624d3c910e8eeb4dbb488c5d27e0e1219c1852eda4b14749569ec7239392789cc9f7cf116
|
7
|
+
data.tar.gz: 3cff5a55338cf639810fc696855c0aa9089f78e5629969447c7f5ddfa6eb157a7cf07c32fa419b9c1ffb17e65698c4ba4ec4a22f3e7b6683bed850fe8442f0d1
|
@@ -95,11 +95,27 @@ module RSpec
|
|
95
95
|
def process_parameters(input, output, explanation:, prefix: nil)
|
96
96
|
input.each do |key, value|
|
97
97
|
name = prefix ? "#{prefix}[#{key}]" : key
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
98
|
+
case value
|
99
|
+
when Hash
|
100
|
+
process_parameters(value, output, explanation: explanation, prefix: name)
|
101
|
+
when Array
|
102
|
+
name += "[]"
|
103
|
+
base_values = []
|
104
|
+
value.each do |subvalue|
|
105
|
+
case subvalue
|
106
|
+
when Hash
|
107
|
+
process_parameters(subvalue, output, explanation: explanation, prefix: name)
|
108
|
+
else
|
109
|
+
base_values << subvalue
|
110
|
+
end
|
111
|
+
end
|
112
|
+
if base_values.any?
|
113
|
+
output[name] ||= explanation[name] || Parameter.new
|
114
|
+
output[name].value = [output[name].value, base_values.to_s].compact.join(", ")
|
115
|
+
end
|
116
|
+
else
|
117
|
+
output[name] ||= explanation[name] || Parameter.new
|
118
|
+
output[name].value = [output[name].value, value].compact.join(", ")
|
103
119
|
end
|
104
120
|
end
|
105
121
|
if prefix.nil?
|