Fixes #1264
This commit is contained in:
@@ -53,12 +53,12 @@ module WPScan
|
|||||||
|
|
||||||
# @return [ String ]
|
# @return [ String ]
|
||||||
def release_date
|
def release_date
|
||||||
@release_date ||= db_data['release_date']
|
@release_date ||= db_data['release_date'] || 'Unknown'
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [ String ]
|
# @return [ String ]
|
||||||
def status
|
def status
|
||||||
@status ||= db_data['status']
|
@status ||= db_data['status'] || 'Unknown'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -91,11 +91,23 @@ describe WPScan::WpVersion do
|
|||||||
subject(:version) { described_class.new('3.8.1') }
|
subject(:version) { described_class.new('3.8.1') }
|
||||||
|
|
||||||
its(:release_date) { should eql '2014-01-23' }
|
its(:release_date) { should eql '2014-01-23' }
|
||||||
|
|
||||||
|
context 'when the version is not in the DB' do
|
||||||
|
subject(:version) { described_class.new('3.8.2') }
|
||||||
|
|
||||||
|
its(:release_date) { should eql 'Unknown' }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#status' do
|
describe '#status' do
|
||||||
subject(:version) { described_class.new('3.8.1') }
|
subject(:version) { described_class.new('3.8.1') }
|
||||||
|
|
||||||
its(:status) { should eql 'outdated' }
|
its(:status) { should eql 'outdated' }
|
||||||
|
|
||||||
|
context 'when the version is not in the DB' do
|
||||||
|
subject(:version) { described_class.new('3.8.2') }
|
||||||
|
|
||||||
|
its(:release_date) { should eql 'Unknown' }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user