File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 1
1
require 'spec_helper'
2
2
require 'ronin/wordlists/cli/commands/download'
3
- require 'ronin/wordlists/root'
4
3
require_relative 'man_page_example'
5
4
6
5
describe Ronin ::Wordlists ::CLI ::Commands ::Download do
7
6
include_examples "man_page"
8
7
9
8
let ( :url ) { 'http://example.com/wordlist.txt' }
10
- let ( :yaml_result ) do
11
- { 'download_wordlist' => { url : url } }
12
- end
13
9
14
10
describe '#run' do
15
11
context 'when the url is provided' do
23
19
context 'when the name is provided' do
24
20
let ( :name ) { 'download_wordlist' }
25
21
26
- context "and exist in wordlist " do
22
+ context "and it exists in the data/wordlists.yml file " do
27
23
before do
28
- allow ( YAML ) . to receive ( :load_file ) . and_return ( yaml_result )
24
+ allow ( Ronin ::Wordlists ::CLI ::WordlistIndex ) . to receive ( :load ) . and_return (
25
+ Ronin ::Wordlists ::CLI ::WordlistIndex . new (
26
+ {
27
+ name => Ronin ::Wordlists ::CLI ::WordlistIndex ::Entry . new (
28
+ name , url : url ,
29
+ summary : 'A test wordlist' ,
30
+ categories : %w[ test ]
31
+ )
32
+ }
33
+ )
34
+ )
29
35
end
30
36
31
- it 'must look up the URL from the wordlists and calls download' do
37
+ it 'must look up the URL from the data/ wordlists.yml and calls download' do
32
38
expect ( subject ) . to receive ( :download ) . with ( url )
33
39
34
40
subject . run ( name )
You can’t perform that action at this time.
0 commit comments