Land #3788 - Adds a spec to ensure HttpServer runs Concern hooks.
commit
54c353a15e
|
@ -6,6 +6,7 @@ require 'msf/core'
|
||||||
require 'msf/core/exploit/http/server'
|
require 'msf/core/exploit/http/server'
|
||||||
|
|
||||||
describe Msf::Exploit::Remote::HttpServer do
|
describe Msf::Exploit::Remote::HttpServer do
|
||||||
|
|
||||||
subject(:server_module) do
|
subject(:server_module) do
|
||||||
mod = Msf::Exploit.allocate
|
mod = Msf::Exploit.allocate
|
||||||
mod.extend described_class
|
mod.extend described_class
|
||||||
|
@ -26,6 +27,9 @@ describe Msf::Exploit::Remote::HttpServer do
|
||||||
Rex::ServiceManager.stub(:start => mock_service)
|
Rex::ServiceManager.stub(:start => mock_service)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Ensure the class is hooks Metasploit::Concern
|
||||||
|
it_should_behave_like 'Metasploit::Concern.run'
|
||||||
|
|
||||||
describe "#add_resource" do
|
describe "#add_resource" do
|
||||||
it "should call the ServiceManager's add_resource" do
|
it "should call the ServiceManager's add_resource" do
|
||||||
server_module.start_service
|
server_module.start_service
|
||||||
|
|
|
@ -22,10 +22,19 @@ require 'rspec/rails/mocks'
|
||||||
|
|
||||||
FILE_FIXTURES_PATH = File.expand_path(File.dirname(__FILE__)) + '/file_fixtures/'
|
FILE_FIXTURES_PATH = File.expand_path(File.dirname(__FILE__)) + '/file_fixtures/'
|
||||||
|
|
||||||
|
# Load the shared examples from the following engines
|
||||||
|
engines = [
|
||||||
|
Metasploit::Concern,
|
||||||
|
Rails
|
||||||
|
]
|
||||||
|
|
||||||
# Requires supporting ruby files with custom matchers and macros, etc,
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||||
# in spec/support/ and its subdirectories.
|
# in spec/support/ and its subdirectories.
|
||||||
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each do |f|
|
engines.each do |engine|
|
||||||
require f
|
support_glob = engine.root.join('spec', 'support', '**', '*.rb')
|
||||||
|
Dir[support_glob].each { |f|
|
||||||
|
require f
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|
Loading…
Reference in New Issue