Adds a spec to ensure HttpServer runs Concern hooks.
parent
55519d8867
commit
46f256a6bd
|
@ -6,6 +6,11 @@ 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
|
||||||
|
# Ensure HttpServer allows Concerns for run-time refinement of the class
|
||||||
|
end
|
||||||
|
|
||||||
|
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 +31,8 @@ describe Msf::Exploit::Remote::HttpServer do
|
||||||
Rex::ServiceManager.stub(:start => mock_service)
|
Rex::ServiceManager.stub(:start => mock_service)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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|
|
||||||
|
support_glob = engine.root.join('spec', 'support', '**', '*.rb')
|
||||||
|
Dir[support_glob].each { |f|
|
||||||
require f
|
require f
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|
Loading…
Reference in New Issue