Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wpscanteam
GitHub Repository: wpscanteam/wpscan
Path: blob/master/spec/app/finders/wp_version_spec.rb
486 views
1
# frozen_string_literal: true
2
3
# If this file is tested alone (rspec path-to-this-file), then there will be an error about
4
# constants not being intilialized. This is due to the Dynamic Finders.
5
6
describe WPScan::Finders::WpVersion::Base do
7
subject(:wp_version) { described_class.new(target) }
8
let(:target) { WPScan::Target.new(url) }
9
let(:url) { 'http://ex.lo/' }
10
11
describe '#finders' do
12
let(:expected) { %w[RSSGenerator AtomGenerator RDFGenerator Readme UniqueFingerprinting] }
13
14
let(:expected_dynamic_finders) { WPScan::DB::DynamicFinders::Wordpress.versions_finders_configs.keys }
15
16
it 'contains the expected finders' do
17
finders = wp_version.finders.map { |f| f.class.to_s.demodulize }
18
19
expect(finders).to match_array expected + expected_dynamic_finders
20
21
expect(finders.first).to eql 'RSSGenerator'
22
expect(finders.last).to eql 'UniqueFingerprinting'
23
end
24
end
25
end
26
27