File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
spec/lib/msf/core/post/linux Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ module Msf
4
4
class Post
5
5
module Linux
6
6
module User
7
+ include ::Msf ::Post ::Common
7
8
#
8
9
# Returns a string of the user's home directory
9
10
#
Original file line number Diff line number Diff line change 13
13
14
14
context 'when the user exists' do
15
15
it 'returns the home directory path from /etc/passwd' do
16
- expect ( tester ) . to receive ( :cmd_exec )
16
+ expect ( subject ) . to receive ( :cmd_exec )
17
17
. with ( expected_command )
18
18
. and_return ( "/home/testuser\n " )
19
19
20
- result = tester . get_home_dir ( user )
20
+ result = subject . get_home_dir ( user )
21
21
expect ( result ) . to eq ( '/home/testuser' )
22
22
end
23
23
end
24
24
25
25
context 'when the user does not exist in /etc/passwd' do
26
26
it 'returns an empty string' do
27
- expect ( tester ) . to receive ( :cmd_exec )
27
+ expect ( subject ) . to receive ( :cmd_exec )
28
28
. with ( expected_command )
29
29
. and_return ( "\n " )
30
30
31
- result = tester . get_home_dir ( user )
31
+ result = subject . get_home_dir ( user )
32
32
expect ( result ) . to eq ( '' )
33
33
end
34
34
end
You can’t perform that action at this time.
0 commit comments