File tree 2 files changed +5
-5
lines changed 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def process!
101
101
completion_percentage = ( processed_count / total_count . to_f * 100 ) . to_i
102
102
yield ( completion_percentage , item . domain ) if block_given?
103
103
end
104
- reject_results_with_word !( @filtered_word ) if @filtered_word
104
+ keep_results_with_word !( @filtered_word ) if @filtered_word
105
105
self
106
106
end
107
107
@@ -136,8 +136,8 @@ def reject_solutions!
136
136
end
137
137
end
138
138
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 |
141
141
body_text = Nokogiri ::HTML . parse ( response . body ) . css ( 'body' ) . text
142
142
body_text . downcase . match? word . downcase
143
143
end
Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ def test_exclude_solutions_rejects_gitlab
50
50
DomainsList . new ( TEST_DOMAINS_FILE , { 'exclude-solutions' : true } ) . list . map ( &:domain )
51
51
end
52
52
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' ] ,
55
55
DomainsList . new ( TEST_DOMAINS_FILE , { filter : 'example' } ) . process! . list . map ( &:domain )
56
56
end
57
57
end
You can’t perform that action at this time.
0 commit comments