Skip to content

Commit

Permalink
fix specs and cves
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Apr 29, 2014
1 parent 8e60213 commit 5e52c27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/bundler/organization_audit.rb
Expand Up @@ -37,7 +37,7 @@ def audit_repo(repo, options)
if download_file(repo, "Gemfile.lock")
command = "bundle-audit"
if options[:ignore_cves] && options[:ignore_cves].any?
command << " --ignore #{options[:ignore_cves].map { |cve| cve.start_with?("CVE-") ? cve : "CVE-#{cve}" }.join(" ")}"
command << " --ignore #{options[:ignore_cves].map { |cve| cve }.join(" ")}"
end
vulnerable = !sh(command)
else
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/organization_audit_spec.rb
Expand Up @@ -44,7 +44,7 @@

context "CLI" do
it "can audit a user" do
result = audit("--user anamartinez")
result = audit("--user anamartinez --ignore ruby-cldr-timezones --ignore enefele")
result.should include "I18N-tools\nNo Gemfile.lock found" # did not use audit when not necessary
result.should include "js-cldr-timezones\nbundle-audit\nNo unpatched versions found" # used audit where necessary
end
Expand All @@ -66,7 +66,7 @@
end

it "ignores CVEs via --ignore-cve" do
result = audit("--user user-with-unpatched-apps --ignore-cve 2013-0269 2>/dev/null", :keep_output => true)
result = audit("--user user-with-unpatched-apps --ignore-cve OSVDB-90074 2>/dev/null", :keep_output => true)
result.should == ""
end

Expand Down

0 comments on commit 5e52c27

Please sign in to comment.