WpPlugin::Vulnerable specs

This commit is contained in:
erwanlr
2013-03-25 21:22:28 +01:00
parent d946ef55a8
commit d6f18943b7
6 changed files with 61 additions and 7 deletions

View File

@@ -2,17 +2,19 @@
shared_examples 'WpItem::Vulnerable' do
# 3 variables have to be set in the described class or subject:
# let(:vulns_file) { }
# let(:vulns_xpath) { }
# let(:expected_vulns) { } The expected Vulnerabilities when using vulns_file and vulns_xpath
# 2 variables have to be set in the described class or subject:
# let(:vulns_file) { }
# let(:expected_vulns) { } The expected Vulnerabilities when using vulns_file and vulns_xpath
#
# 1 variable is optional, used if supplied, otherwise subject.vulns_xpath is used
# let(:vulns_xpath) { }
describe '#vulnerabilities' do
let(:empty_file) { MODELS_FIXTURES + '/wp_item/vulnerable/empty.xml' }
after do
subject.vulns_file = @vulns_file
subject.vulns_xpath = vulns_xpath
subject.vulns_xpath = vulns_xpath if defined?(vulns_xpath)
result = subject.vulnerabilities
result.should be_a Vulnerabilities