Add unit tests for RPC's getg

bug/bundler_fix
Jon Hart 2015-01-16 10:39:05 -08:00
parent e7566944df
commit b2e9e43f3d
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
# -*- coding:binary -*-
require 'spec_helper'
require 'msf/core/rpc/v10/rpc_base'
require 'msf/core/rpc/v10/rpc_core'
require 'msf/core/rpc/v10/service'
describe Msf::RPC::RPC_Core do
include_context 'Msf::Simple::Framework'
let(:service) do
Msf::RPC::Service.new(framework)
end
let(:core) do
Msf::RPC::RPC_Core.new(service)
end
describe '#rpc_getg' do
it 'should show an empty value if the variable is unset' do
expect(core.rpc_getg('FOO')).to eq({'FOO' => ''})
end
it 'should show the correct value if the variable is set' do
core.rpc_setg('FOO', 'BAR')
expect(core.rpc_getg('FOO')).to eq({'FOO' => 'BAR'})
end
end
end