Skip to content

Commit e483fe4

Browse files
committed
Add spec for HttpServer#hardcoded_uripath
1 parent 3c42fe5 commit e483fe4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,23 @@
6767

6868
end
6969

70+
describe "#hardcoded_uripath" do
71+
it "should call the ServiceManager's add_resource" do
72+
server_module.start_service
73+
74+
mock_service.should_receive(:add_resource)
75+
server_module.hardcoded_uripath('foo')
76+
end
77+
78+
it "should re-raise if the resource has already been added" do
79+
server_module.start_service
80+
81+
mock_service.should_receive(:add_resource).ordered.and_raise(RuntimeError)
82+
83+
expect { server_module.hardcoded_uripath('foo') }.to raise_error
84+
end
85+
end
86+
7087
end
7188

7289

0 commit comments

Comments
 (0)