Permalink
Browse files

hide filter messages from HTML output

  • Loading branch information...
1 parent 9e5ab97 commit 9462bef0b96e1daaafca406f464695c12a9cf3e4 @dchelimsky dchelimsky committed Jul 3, 2010
@@ -91,7 +91,7 @@ def settings
@settings ||= {}
end
- def clear_inclusion_filter
+ def clear_inclusion_filter # :nodoc:
self.filter = nil
end
@@ -226,6 +226,7 @@ def alias_example_to(new_name, extra_options={})
end
def filter_run_including(options={})
+ # TODO (DC 2010-07-03) this should probably warn when the unless clause returns true
self.filter = options unless filter and filter[:line_number] || filter[:full_description]
end
@@ -71,6 +71,9 @@ def example_pending(example)
def example_failed(example)
end
+ def message(message)
+ end
+
# This method is invoked at the beginning of the execution of each example group.
# +example_group+ is the example_group.
#
@@ -4,6 +4,10 @@ module Formatters
class BaseTextFormatter < BaseFormatter
+ def message(message)
+ output.puts message
+ end
+
def dump_failures
output.puts
failed_examples.each_with_index do |failed_example, index|
@@ -10,6 +10,9 @@ class HtmlFormatter < BaseTextFormatter
def method_missing(m, *a, &b)
# no-op
end
+
+ def message(message)
+ end
def initialize(output)
super
View
@@ -59,11 +59,11 @@ def preceding_declaration_line(filter_line)
def announce_inclusion_filter
if inclusion_filter
if RSpec.configuration.run_all_when_everything_filtered? && RSpec.world.example_count == 0
- RSpec.configuration.output_stream.puts "No examples were matched by #{inclusion_filter.inspect}, running all"
+ RSpec.configuration.reporter.message "No examples were matched by #{inclusion_filter.inspect}, running all"
RSpec.configuration.clear_inclusion_filter
filtered_examples.clear
else
- RSpec.configuration.output_stream.puts "Run filtered using #{inclusion_filter.inspect}"
+ RSpec.configuration.reporter.message "Run filtered using #{inclusion_filter.inspect}"
end
end
end

0 comments on commit 9462bef

Please sign in to comment.