30 lines
1.1 KiB
Ruby
30 lines
1.1 KiB
Ruby
# TODO
|
|
|
|
describe "#vulnerabilities" do
|
|
let(:location_url) { "http://example.localhost/" }
|
|
let(:fixtures_dir) { SPEC_FIXTURES_WPSCAN_WP_PLUGIN_DIR + "/vulnerabilities" }
|
|
let(:vulns_xml) { fixtures_dir + "/plugin_vulns.xml" }
|
|
let(:wp_plugin) { WpPlugin.new(:url => location_url,
|
|
:name => "spec-plugin",
|
|
:path => "plugins/spec-plugin/",
|
|
:vulns_xml => vulns_xml)
|
|
}
|
|
|
|
|
|
it "should return an empty array when no vulnerabilities are found" do
|
|
WpPlugin.new(:url => "http://example.localhost/",
|
|
:name => "no-vulns",
|
|
:path => "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 |