Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/bundler/audit/scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,8 @@ def scan_sources(options={})
def scan_specs(options={})
return enum_for(__method__,options) unless block_given?

ignore = if options[:ignore]
Set.new(options[:ignore])
else
config.ignore
end
ignore = config.ignore
ignore.merge(Set.new(options[:ignore])) if options[:ignore]

@lockfile.specs.each do |gem|
@database.check_gem(gem) do |advisory|
Expand Down
11 changes: 11 additions & 0 deletions spec/scanner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@
expect(ids).not_to include('OSVDB-89025')
end

context "when the :ignore option is given" do
subject { scanner.scan(ignore: ['CVE-2013-0156']) }

it "should ignore the specified advisories" do
ids = subject.map { |result| result.advisory.id }

expect(ids).not_to include('CVE-2013-0156')
expect(ids).not_to include('OSVDB-89025')
end
end

context "when config path is absolute" do
let(:bundle) { 'unpatched_gems' }
let(:absolute_config_path) { File.absolute_path(File.join('spec','bundle','unpatched_gems_with_dot_configuration', '.bundler-audit.yml')) }
Expand Down