Skip to content

Commit bdde039

Browse files
committed
Alphabetize hash keys
1 parent 100082d commit bdde039

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

lib/cc/engine/bundler_audit.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,23 @@ def issue_from_raw(raw_issue)
5050
end
5151
end
5252
{
53-
type: 'Issue',
53+
categories: ['Security'],
5454
check_name: "Insecure Dependency",
55+
content: {
56+
body: content_body(raw_issue_hash)
57+
},
5558
description: raw_issue_hash['Title'],
56-
categories: ['Security'],
57-
remediation_points: remediation_points(
58-
raw_issue_hash['Version'], raw_issue_hash['Solution']
59-
),
6059
location: {
6160
path: 'Gemfile.lock',
6261
lines: {
6362
begin: line_number,
6463
end: line_number
6564
}
6665
},
67-
content: {
68-
body: content_body(raw_issue_hash)
69-
}
66+
remediation_points: remediation_points(
67+
raw_issue_hash['Version'], raw_issue_hash['Solution']
68+
),
69+
type: 'Issue',
7070
}
7171
end
7272

spec/cc/engine/bundler_audit_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ module CC::Engine
2626
Solution: upgrade to ~> 2.3.18, ~> 3.1.12, >= 3.2.13
2727
EOF
2828
result = {
29-
type: "Issue",
29+
categories: ["Security"],
3030
check_name: "Insecure Dependency",
31+
content: {
32+
body: "**Advisory**: OSVDB-91452\n\n**Criticality**: Medium\n\n**URL**: http://www.osvdb.org/show/osvdb/91452\n\n**Solution**: upgrade to ~> 2.3.18, ~> 3.1.12, >= 3.2.13"
33+
},
3134
description: "XSS vulnerability in sanitize_css in Action Pack",
32-
categories: ["Security"],
33-
remediation_points: 500_000,
3435
location: {
3536
path: "Gemfile.lock",
3637
lines: { begin: nil, end: nil }
3738
},
38-
content: {
39-
body: "**Advisory**: OSVDB-91452\n\n**Criticality**: Medium\n\n**URL**: http://www.osvdb.org/show/osvdb/91452\n\n**Solution**: upgrade to ~> 2.3.18, ~> 3.1.12, >= 3.2.13"
40-
},
39+
remediation_points: 500_000,
40+
type: "Issue",
4141
}.to_json
4242
io = StringIO.new
4343
directory = "/c"
@@ -54,7 +54,7 @@ module CC::Engine
5454
audit.run
5555
end
5656

57-
expect(io.string).to match("#{result}\0")
57+
expect(io.string).to eq("#{result}\0")
5858
end
5959
end
6060
end

0 commit comments

Comments
 (0)