@@ -106,23 +106,21 @@ def reporter
106
106
# Notify reporter of filters.
107
107
def announce_filters
108
108
fail_if_config_and_cli_options_invalid
109
- return if @configuration . silence_filter_announcements?
110
-
111
109
filter_announcements = [ ]
112
110
113
111
announce_inclusion_filter filter_announcements
114
112
announce_exclusion_filter filter_announcements
115
113
116
114
unless filter_manager . empty?
117
115
if filter_announcements . length == 1
118
- reporter . message ( "Run options: #{ filter_announcements [ 0 ] } " )
116
+ report_filter_message ( "Run options: #{ filter_announcements [ 0 ] } " )
119
117
else
120
- reporter . message ( "Run options:\n #{ filter_announcements . join ( "\n " ) } " )
118
+ report_filter_message ( "Run options:\n #{ filter_announcements . join ( "\n " ) } " )
121
119
end
122
120
end
123
121
124
122
if @configuration . run_all_when_everything_filtered? && example_count . zero? && !@configuration . only_failures?
125
- reporter . message ( "#{ everything_filtered_message } ; ignoring #{ inclusion_filter . description } " )
123
+ report_filter_message ( "#{ everything_filtered_message } ; ignoring #{ inclusion_filter . description } " )
126
124
filtered_examples . clear
127
125
inclusion_filter . clear
128
126
end
@@ -131,12 +129,17 @@ def announce_filters
131
129
132
130
example_groups . clear
133
131
if filter_manager . empty?
134
- reporter . message ( "No examples found." )
132
+ report_filter_message ( "No examples found." )
135
133
elsif exclusion_filter . empty? || inclusion_filter . empty?
136
- reporter . message ( everything_filtered_message )
134
+ report_filter_message ( everything_filtered_message )
137
135
end
138
136
end
139
137
138
+ # @private
139
+ def report_filter_message ( message )
140
+ reporter . message ( message ) unless @configuration . silence_filter_announcements?
141
+ end
142
+
140
143
# @private
141
144
def everything_filtered_message
142
145
"\n All examples were filtered out"
0 commit comments