Skip to content

Commit 54c353a

Browse files
committed
Land rapid7#3788 - Adds a spec to ensure HttpServer runs Concern hooks.
2 parents e810acd + a617556 commit 54c353a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

spec/lib/msf/core/exploit/http/server_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
require 'msf/core/exploit/http/server'
77

88
describe Msf::Exploit::Remote::HttpServer do
9+
910
subject(:server_module) do
1011
mod = Msf::Exploit.allocate
1112
mod.extend described_class
@@ -26,6 +27,9 @@
2627
Rex::ServiceManager.stub(:start => mock_service)
2728
end
2829

30+
# Ensure the class is hooks Metasploit::Concern
31+
it_should_behave_like 'Metasploit::Concern.run'
32+
2933
describe "#add_resource" do
3034
it "should call the ServiceManager's add_resource" do
3135
server_module.start_service

spec/spec_helper.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,19 @@
2222

2323
FILE_FIXTURES_PATH = File.expand_path(File.dirname(__FILE__)) + '/file_fixtures/'
2424

25+
# Load the shared examples from the following engines
26+
engines = [
27+
Metasploit::Concern,
28+
Rails
29+
]
30+
2531
# Requires supporting ruby files with custom matchers and macros, etc,
2632
# in spec/support/ and its subdirectories.
27-
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each do |f|
28-
require f
33+
engines.each do |engine|
34+
support_glob = engine.root.join('spec', 'support', '**', '*.rb')
35+
Dir[support_glob].each { |f|
36+
require f
37+
}
2938
end
3039

3140
RSpec.configure do |config|

0 commit comments

Comments
 (0)