Change method name and update rspec
parent
3412f31f85
commit
3f994e964d
|
@ -12,14 +12,12 @@ module System
|
|||
include Msf::Post::Common
|
||||
include Msf::Post::File
|
||||
|
||||
public
|
||||
|
||||
# Returns system information from build.prop.
|
||||
#
|
||||
# @return [Hash] System information.
|
||||
def get_sysinfo
|
||||
def get_build_prop
|
||||
sys_data = {}
|
||||
build_prop = get_build_prop
|
||||
build_prop = cmd_exec('cat /system/build.prop')
|
||||
|
||||
return sys_data if build_prop.blank?
|
||||
|
||||
|
@ -30,10 +28,4 @@ module System
|
|||
return sys_data
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def get_build_prop
|
||||
cmd_exec('cat /system/build.prop')
|
||||
end
|
||||
|
||||
end ; end ; end ; end
|
|
@ -19,15 +19,15 @@ describe Msf::Post::Android::Priv do
|
|||
end
|
||||
|
||||
describe '#is_root?' do
|
||||
context 'when root' do
|
||||
it 'returns TrueClass' do
|
||||
context 'when not root' do
|
||||
it 'returns FalseClass' do
|
||||
allow(subject).to receive(:cmd_exec).with('id').and_return(nonroot_id)
|
||||
expect(subject.is_root?).to be_falsey
|
||||
end
|
||||
end
|
||||
|
||||
context 'when non root' do
|
||||
it 'reeturns FalseClass' do
|
||||
context 'when root' do
|
||||
it 'returns TrueClass' do
|
||||
allow(subject).to receive(:cmd_exec).with('id').and_return(root_id)
|
||||
expect(subject.is_root?).to be_truthy
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue