File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
describe Ronin ::Wordlists ::CLI ::Commands ::List do
6
6
include_examples "man_page"
7
+
8
+ describe '#run' do
9
+ context 'with given name' do
10
+ let ( :name ) { 'list' }
11
+ let ( :wordlists ) { [ 'list1' , 'list2' ] }
12
+
13
+ it 'must list wordlists matching the specified name' do
14
+ expect ( subject . wordlist_dir ) . to receive ( :list ) . with ( name ) . and_return ( wordlists )
15
+ expect {
16
+ subject . run ( name )
17
+ } . to output (
18
+ [
19
+ " list1" ,
20
+ " list2" ,
21
+ ""
22
+ ] . join ( $/)
23
+ ) . to_stdout
24
+ end
25
+ end
26
+
27
+ context 'witout given name' do
28
+ let ( :wordlists ) { [ 'wordlist1' , 'wordlist2' , 'wordlist3' ] }
29
+
30
+ it 'must list all wordlists' do
31
+ expect ( subject . wordlist_dir ) . to receive ( :list ) . with ( no_args ) . and_return ( wordlists )
32
+ expect {
33
+ subject . run
34
+ } . to output (
35
+ [
36
+ " wordlist1" ,
37
+ " wordlist2" ,
38
+ " wordlist3" ,
39
+ ""
40
+ ] . join ( $/)
41
+ ) . to_stdout
42
+ end
43
+ end
44
+ end
7
45
end
You can’t perform that action at this time.
0 commit comments