Work on json database file parsing, still needs some work.
This commit is contained in:
@@ -10,7 +10,7 @@ shared_examples 'WpItem::Vulnerable' do
|
||||
# let(:vulns_xpath) { }
|
||||
|
||||
describe '#vulnerabilities' do
|
||||
let(:empty_file) { MODELS_FIXTURES + '/wp_item/vulnerable/empty.xml' }
|
||||
let(:empty_file) { MODELS_FIXTURES + '/wp_item/vulnerable/empty.json' }
|
||||
|
||||
before do
|
||||
stub_request(:get, /.*\/readme\.txt/i)
|
||||
@@ -19,7 +19,7 @@ shared_examples 'WpItem::Vulnerable' do
|
||||
|
||||
after do
|
||||
subject.vulns_file = @vulns_file
|
||||
subject.vulns_xpath = vulns_xpath if defined?(vulns_xpath)
|
||||
subject.identifier = identifier if defined?(identifier)
|
||||
|
||||
result = subject.vulnerabilities
|
||||
expect(result).to be_a Vulnerabilities
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
require WPSCAN_LIB_DIR + '/wp_target'
|
||||
|
||||
shared_examples 'WpItems::Detectable' do
|
||||
let(:vulns_file) { fixtures_dir + '/vulns.xml' }
|
||||
let(:vulns_file) { fixtures_dir + '/vulns.json' }
|
||||
let(:targets_items_file) { fixtures_dir + '/targets.txt' }
|
||||
let(:wp_content_dir) { 'wp-content' }
|
||||
let(:wp_plugins_dir) { wp_content_dir + '/plugins' }
|
||||
|
||||
@@ -13,14 +13,14 @@ shared_examples 'WpPlugin::Vulnerable' do
|
||||
|
||||
context 'when the :vulns_file is already set' do
|
||||
it 'returns it' do
|
||||
@expected = 'test.xml'
|
||||
@expected = 'test.json'
|
||||
subject.vulns_file = @expected
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#vulns_xpath' do
|
||||
its(:vulns_xpath) { is_expected.to eq "//plugin[@name='plugin-name']/vulnerability" }
|
||||
describe '#identifier' do
|
||||
its(:identifier) { is_expected.to eq 'plugin-name' }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -13,14 +13,14 @@ shared_examples 'WpTheme::Vulnerable' do
|
||||
|
||||
context 'when the :vulns_file is already set' do
|
||||
it 'returns it' do
|
||||
@expected = 'test.xml'
|
||||
@expected = 'test.json'
|
||||
subject.vulns_file = @expected
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#vulns_xpath' do
|
||||
its(:vulns_xpath) { is_expected.to eq "//theme[@name='theme-name']/vulnerability" }
|
||||
describe '#identifier' do
|
||||
its(:identifier) { is_expected.to eq 'theme-name' }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -13,14 +13,14 @@ shared_examples 'WpVersion::Vulnerable' do
|
||||
|
||||
context 'when the :vulns_file is already set' do
|
||||
it 'returns it' do
|
||||
@expected = 'test.xml'
|
||||
@expected = 'test.json'
|
||||
subject.vulns_file = @expected
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#vulns_xpath' do
|
||||
its(:vulns_xpath) { is_expected.to eq "//wordpress[@version='1.2']/vulnerability" }
|
||||
describe '#identifier' do
|
||||
its(:identifier) { is_expected.to eq '1.2' }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user