Land #3788 - Adds a spec to ensure HttpServer runs Concern hooks.

bug/bundler_fix
sinn3r 2014-09-12 12:05:55 -05:00
commit 54c353a15e
No known key found for this signature in database
GPG Key ID: 2384DB4EF06F730B
2 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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|