Errors moved into their own namespace - Ref #1315

This commit is contained in:
erwanlr
2019-03-19 19:09:16 +00:00
parent 357e13be2b
commit f1657164d5
15 changed files with 85 additions and 73 deletions

View File

@@ -70,7 +70,7 @@ describe WPScan::Controller::Core do
let(:cli_args) { "#{super()} --no-update" }
it 'raises an error' do
expect { core.update_db_required? }. to raise_error(WPScan::MissingDatabaseFile)
expect { core.update_db_required? }. to raise_error(WPScan::Error::MissingDatabaseFile)
end
end
@@ -199,7 +199,7 @@ describe WPScan::Controller::Core do
let(:redirection) { 'http://g.com/' }
it 'raises an error' do
expect { core.before_scan }.to raise_error(CMSScanner::HTTPRedirectError)
expect { core.before_scan }.to raise_error(CMSScanner::Error::HTTPRedirect)
end
end
@@ -218,7 +218,7 @@ describe WPScan::Controller::Core do
it 'raises an error' do
expect(core.target).to receive(:wordpress?).with(:mixed).and_return(false)
expect { core.before_scan }.to raise_error(WPScan::NotWordPressError)
expect { core.before_scan }.to raise_error(WPScan::Error::NotWordPress)
end
end
end
@@ -230,7 +230,7 @@ describe WPScan::Controller::Core do
before { expect(core).to receive(:load_server_module) }
it 'raises an error' do
expect { core.before_scan }.to raise_error(WPScan::WordPressHostedError)
expect { core.before_scan }.to raise_error(WPScan::Error::WordPressHosted)
end
end
@@ -253,7 +253,7 @@ describe WPScan::Controller::Core do
context 'when no --force' do
it 'raises an error' do
expect { core.before_scan }.to raise_error(WPScan::NotWordPressError)
expect { core.before_scan }.to raise_error(WPScan::Error::NotWordPress)
end
end

View File

@@ -23,7 +23,7 @@ describe WPScan::Controller::CustomDirectories do
before { expect(controller.target).to receive(:content_dir) }
it 'raises an exception' do
expect { controller.before_scan }.to raise_error(WPScan::WpContentDirNotDetected)
expect { controller.before_scan }.to raise_error(WPScan::Error::WpContentDirNotDetected)
end
end

View File

@@ -75,7 +75,7 @@ describe WPScan::Controller::PasswordAttack do
let(:attack) { 'xmlrpc' }
it 'raises an error' do
expect { controller.attacker }.to raise_error(WPScan::XMLRPCNotDetected)
expect { controller.attacker }.to raise_error(WPScan::Error::XMLRPCNotDetected)
end
end
@@ -83,7 +83,7 @@ describe WPScan::Controller::PasswordAttack do
let(:attack) { 'xmlrpc-multicall' }
it 'raises an error' do
expect { controller.attacker }.to raise_error(WPScan::XMLRPCNotDetected)
expect { controller.attacker }.to raise_error(WPScan::Error::XMLRPCNotDetected)
end
end
end