bugfixing and rspec tests
This commit is contained in:
@@ -22,7 +22,9 @@ describe WpPlugin do
|
||||
before :each do
|
||||
@instance = WpItem.new(:url => "http://sub.example.com/path/to/wordpress/",
|
||||
:path => "plugins/test/asdf.php",
|
||||
:vulns_xml => "XXX.xml"
|
||||
:vulns_xml => "XXX.xml",
|
||||
:name => "test",
|
||||
:vulns_xpath => "XX"
|
||||
)
|
||||
end
|
||||
|
||||
@@ -174,7 +176,8 @@ describe WpPlugin do
|
||||
it "should return false" do
|
||||
instance2 = WpItem.new(:url => "http://sub.example.com/path/to/wordpress/",
|
||||
:path => "plugins/newname/asdf.php",
|
||||
:vulns_xml => "XXX.xml"
|
||||
:vulns_xml => "XXX.xml",
|
||||
:vulns_xpath => "XX"
|
||||
)
|
||||
(@instance==instance2).should == false
|
||||
end
|
||||
@@ -182,7 +185,8 @@ describe WpPlugin do
|
||||
it "should return true" do
|
||||
instance2 = WpItem.new(:url => "http://sub.example.com/path/to/wordpress/",
|
||||
:path => "plugins/test/asdf.php",
|
||||
:vulns_xml => "XXX.xml"
|
||||
:vulns_xml => "XXX.xml",
|
||||
:vulns_xpath => "XX"
|
||||
)
|
||||
(@instance==instance2).should == true
|
||||
end
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# 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(: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/",
|
||||
@@ -24,7 +24,7 @@ describe "#vulnerabilities" do
|
||||
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'
|
||||
vulnerabilities[0].title.should === "WPScan Spec"
|
||||
vulnerabilities[1].title.should === "Spec SQL Injection"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user