Skip to content

Commit

Permalink
hide filter messages from HTML output
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jul 4, 2010
1 parent 9e5ab97 commit 9462bef
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/rspec/core/configuration.rb
Expand Up @@ -91,7 +91,7 @@ def settings
@settings ||= {}
end

def clear_inclusion_filter
def clear_inclusion_filter # :nodoc:
self.filter = nil
end

Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions lib/rspec/core/formatters/base_formatter.rb
Expand Up @@ -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.
#
Expand Down
4 changes: 4 additions & 0 deletions lib/rspec/core/formatters/base_text_formatter.rb
Expand Up @@ -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|
Expand Down
3 changes: 3 additions & 0 deletions lib/rspec/core/formatters/html_formatter.rb
Expand Up @@ -10,6 +10,9 @@ class HtmlFormatter < BaseTextFormatter
def method_missing(m, *a, &b)
# no-op
end

def message(message)
end

def initialize(output)
super
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/core/world.rb
Expand Up @@ -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
Expand Down

0 comments on commit 9462bef

Please sign in to comment.