26 lines
964 B
Ruby
26 lines
964 B
Ruby
# TODO
|
|
|
|
describe "#vulnerabilities" do
|
|
let(:location_url) { 'http://example.localhost/wp-content/plugins/spec-plugin/' }
|
|
let(:fixtures_dir) { SPEC_FIXTURES_WPSCAN_WP_PLUGIN_DIR + '/vulnerabilities' }
|
|
let(:vulns_xml) { fixtures_dir + '/plugin_vulns.xml' }
|
|
let(:wp_plugin) { WpPlugin.new(location_url, :vulns_xml => vulns_xml) }
|
|
|
|
|
|
it "should return an empty array when no vulnerabilities are found" do
|
|
WpPlugin.new(
|
|
'http://example.localhost/wp-content/plugins/no-vulns/',
|
|
:vulns_xml => vulns_xml
|
|
).vulnerabilities.should be_empty
|
|
end
|
|
|
|
it "should return an arry with 2 vulnerabilities" do
|
|
vulnerabilities = wp_plugin.vulnerabilities
|
|
|
|
vulnerabilities.should_not be_empty
|
|
vulnerabilities.length.should == 2
|
|
vulnerabilities.each { |vulnerability| vulnerability.should be_a WpVulnerability }
|
|
vulnerabilities[0].title.should === 'WPScan Spec'
|
|
vulnerabilities[1].title.should === 'Spec SQL Injection'
|
|
end
|
|
end |