Path: blob/master/spec/app/finders/plugin_version_spec.rb
486 views
# frozen_string_literal: true12describe WPScan::Finders::PluginVersion::Base do3subject(:plugin_version) { described_class.new(plugin) }4let(:plugin) { WPScan::Model::Plugin.new(slug, target) }5let(:target) { WPScan::Target.new('http://wp.lab/') }6let(:default_finders) { %w[Readme] }78describe '#finders' do9after do10expect(target).to receive(:content_dir).and_return('wp-content')11expect(plugin_version.finders.map { |f| f.class.to_s.demodulize }).to match_array @expected12end1314context 'when no related dynamic finders' do15let(:slug) { 'spec' }1617it 'contains the default finders' do18@expected = default_finders19end20end2122# Dynamic Version Finders are not tested here, they are in23# spec/lib/finders/dynamic_finder/plugin_versions_spec24context 'when dynamic finders' do25WPScan::DB::DynamicFinders::Plugin.versions_finders_configs.each do |plugin_slug, configs|26context "when #{plugin_slug} plugin" do27let(:slug) { plugin_slug }2829it 'contains the expected finders (default + the dynamic ones)' do30@expected = default_finders + configs.keys31end32end33end34end35end36end373839