This commit is contained in:
erwanlr
2019-03-17 06:59:44 +00:00
parent 5088ece8a1
commit 57c99c4a34
3 changed files with 8 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ module WPScan
return if target.content_dir
raise 'Unable to identify the wp-content dir, please supply it with --wp-content-dir'
raise WpContentDirNotDetected
end
end
end

View File

@@ -19,4 +19,10 @@ module WPScan
'The WordPress version is invalid'
end
end
class WpContentDirNotDetected < Error
def to_s
'Unable to identify the wp-content dir, please supply it with --wp-content-dir'
end
end
end

View File

@@ -22,12 +22,8 @@ describe WPScan::Controller::CustomDirectories do
context 'when the content_dir is not found and not supply' do
before { expect(controller.target).to receive(:content_dir) }
let(:exception) do
'Unable to identify the wp-content dir, please supply it with --wp-content-dir'
end
it 'raises an exception' do
expect { controller.before_scan }.to raise_error(exception)
expect { controller.before_scan }.to raise_error(WPScan::WpContentDirNotDetected)
end
end