some more work for #179
This commit is contained in:
@@ -5,6 +5,7 @@ class WpItem
|
||||
attr_accessor :vulns_file, :vulns_xpath
|
||||
|
||||
# Get the vulnerabilities associated to the WpItem
|
||||
# Filters out already fixed vulnerabilities
|
||||
#
|
||||
# @return [ Vulnerabilities ]
|
||||
def vulnerabilities
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
class VersionCompare
|
||||
|
||||
# Compares two version strings. Returns true if version1 is equal to version2
|
||||
# or when version1 is older than version2
|
||||
#
|
||||
# @param [ String ] version1
|
||||
# @param [ String ] version2
|
||||
#
|
||||
# @return [ Boolean ]
|
||||
def self.is_newer_or_same?(version1, version2)
|
||||
(version1 == version2) || (Gem::Version.new(version1) < Gem::Version.new(version2))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,9 +12,7 @@ shared_examples 'WpItem::Vulnerable' do
|
||||
describe '#vulnerabilities' do
|
||||
let(:empty_file) { MODELS_FIXTURES + '/wp_item/vulnerable/empty.xml' }
|
||||
|
||||
before do
|
||||
stub_request(:get, /.*/)
|
||||
end
|
||||
before { stub_request(:get, /.*/) }
|
||||
|
||||
after do
|
||||
subject.vulns_file = @vulns_file
|
||||
|
||||
Reference in New Issue
Block a user