Adds a spec to ensure HttpServer runs Concern hooks.

bug/bundler_fix
Joe Vennix 2014-09-12 10:52:57 -05:00
parent 55519d8867
commit 46f256a6bd
No known key found for this signature in database
GPG Key ID: 127B05FB3E85A2B0
2 changed files with 18 additions and 2 deletions

View File

@ -6,6 +6,11 @@ require 'msf/core'
require 'msf/core/exploit/http/server'
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
mod = Msf::Exploit.allocate
mod.extend described_class
@ -26,6 +31,8 @@ describe Msf::Exploit::Remote::HttpServer do
Rex::ServiceManager.stub(:start => mock_service)
end
it_should_behave_like 'Metasploit::Concern.run'
describe "#add_resource" do
it "should call the ServiceManager's add_resource" do
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/'
# Load the shared examples from the following engines
engines = [
Metasploit::Concern,
Rails
]
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each do |f|
require f
engines.each do |engine|
support_glob = engine.root.join('spec', 'support', '**', '*.rb')
Dir[support_glob].each { |f|
require f
}
end
RSpec.configure do |config|