Fix #208 - Fixed vulnerable plugins still appear in the results

This commit is contained in:
erwanlr
2013-07-24 14:18:02 +02:00
parent 73f42bb73d
commit 669e1458da
4 changed files with 36 additions and 5 deletions

View File

@@ -39,6 +39,23 @@ shared_examples 'WpItem::Vulnerable' do
end
end
describe '#vulnerable?' do
after do
subject.stub(:vulnerabilities).and_return(@stub)
subject.vulnerable?.should == @expected
end
it 'returns false when no vulnerabilities' do
@stub = []
@expected = false
end
it 'returns true when vulnerabilities' do
@stub = ['not empty']
@expected = true
end
end
describe '#vulnerable_to?' do
let(:version_orig) { '1.5.6' }
let(:version_newer) { '1.6' }