Sha256: 40405b830ab0960e6ea64d9f7c160714d9549c113e3608789c6f0d89f3513041

Contents?: true

Size: 1022 Bytes

Versions: 5

Compression:

Stored size: 1022 Bytes

Contents

# To display tag information while running the specs
# USAGE : Set the tags first if using in command line
# $ export tags=foo then run spec with following options
#["--require rubygems,taglob/spec/tag_html_formatter --format TagHtmlFormatter:#{file_name}"]  
# Example: 
# $ spec --require rubygems,taglob/spec/tag_html_formatter --format TagHtmlFormatter:#{file_name}.html

require 'spec/runner/formatter/html_formatter'

class Spec::Runner::Formatter::HtmlFormatter    
  alias :original_report_header :report_header
  alias :original_global_styles :global_styles
  def report_header
    if ENV['tags'].nil?
      original_report_header
    else
      original_report_header + "<div id='tag-header'><h3>These specs contain the following tags: #{ENV['tags']}</h3></div>"          
    end        
  end 
  
  def global_styles        
    original_global_styles + ".rspec-report h3 {margin: 0px 10px 0px 10px; padding: 10px;font: normal 11px ,'Lucida Grande', Helvetica, sans-serif;font-size: 1.2em;}"        
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
scudco-taglob-1.1.0 lib/taglob/spec/tag_html_formatter.rb
scudco-taglob-1.1.1 lib/taglob/spec/tag_html_formatter.rb
scudco-taglob-1.1.2 lib/taglob/spec/tag_html_formatter.rb
taglob-1.1.2 lib/taglob/spec/tag_html_formatter.rb
taglob-1.1.1 lib/taglob/spec/tag_html_formatter.rb