File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def process!
101101 completion_percentage = ( processed_count / total_count . to_f * 100 ) . to_i
102102 yield ( completion_percentage , item . domain ) if block_given?
103103 end
104- reject_results_with_word !( @filtered_word ) if @filtered_word
104+ keep_results_with_word !( @filtered_word ) if @filtered_word
105105 self
106106 end
107107
@@ -136,8 +136,8 @@ def reject_solutions!
136136 end
137137 end
138138
139- def reject_results_with_word !( word )
140- @list . reject! do |response |
139+ def keep_results_with_word !( word )
140+ @list . keep_if do |response |
141141 body_text = Nokogiri ::HTML . parse ( response . body ) . css ( 'body' ) . text
142142 body_text . downcase . match? word . downcase
143143 end
Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ def test_exclude_solutions_rejects_gitlab
5050 DomainsList . new ( TEST_DOMAINS_FILE , { 'exclude-solutions' : true } ) . list . map ( &:domain )
5151 end
5252
53- def test_filter_word_rejects_results_with_word_in_body
54- assert_equal [ 'subdomain. example.com' , 'gitlab .com'] ,
53+ def test_filter_word_keeps_only_results_with_word_in_body
54+ assert_equal [ 'example.com' ] ,
5555 DomainsList . new ( TEST_DOMAINS_FILE , { filter : 'example' } ) . process! . list . map ( &:domain )
5656 end
5757end
You can’t perform that action at this time.
0 commit comments