Skip to content

Commit b2e9e43

Browse files
committed
Add unit tests for RPC's getg
1 parent e756694 commit b2e9e43

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- coding:binary -*-
2+
require 'spec_helper'
3+
4+
require 'msf/core/rpc/v10/rpc_base'
5+
require 'msf/core/rpc/v10/rpc_core'
6+
require 'msf/core/rpc/v10/service'
7+
8+
describe Msf::RPC::RPC_Core do
9+
include_context 'Msf::Simple::Framework'
10+
11+
let(:service) do
12+
Msf::RPC::Service.new(framework)
13+
end
14+
15+
let(:core) do
16+
Msf::RPC::RPC_Core.new(service)
17+
end
18+
19+
describe '#rpc_getg' do
20+
it 'should show an empty value if the variable is unset' do
21+
expect(core.rpc_getg('FOO')).to eq({'FOO' => ''})
22+
end
23+
it 'should show the correct value if the variable is set' do
24+
core.rpc_setg('FOO', 'BAR')
25+
expect(core.rpc_getg('FOO')).to eq({'FOO' => 'BAR'})
26+
end
27+
end
28+
end

0 commit comments

Comments
 (0)