File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 263
263
expectation = JSON . parse ( JSON_STRING )
264
264
result = formatter . result
265
265
266
- expectation . each do |hash |
267
- if hash [ "gems" ]
268
- hash [ "gems" ] . each do |gem |
269
- gem [ "transitive_dependencies" ] &.sort!
270
- end
271
- end
272
- end
266
+ [ expectation , result ] . each do |data |
267
+ data . each do |hash |
268
+ next unless hash [ "gems" ]
273
269
274
- result . each do |hash |
275
- if hash [ "gems" ]
276
270
hash [ "gems" ] . each do |gem |
277
- gem [ "transitive_dependencies" ] &.sort!
271
+ next unless gem [ "transitive_dependencies" ]
272
+
273
+ gem [ "transitive_dependencies" ] . map! do |dep |
274
+ name , constraints = dep . split ( /[()]/ )
275
+ next dep unless constraints
276
+
277
+ normalized_constraints = constraints . split ( /,\s */ ) . sort . join ( ', ' )
278
+ "#{ name } (#{ normalized_constraints } )"
279
+ end . sort!
278
280
end
279
281
end
280
282
end
You can’t perform that action at this time.
0 commit comments