Class | Spec::Runner::Formatter::Story::HtmlFormatter |
In: |
lib/spec/runner/formatter/story/html_formatter.rb
|
Parent: | BaseTextFormatter |
# File lib/spec/runner/formatter/story/html_formatter.rb, line 34 34: def collected_steps(steps) 35: unless steps.empty? 36: @output.puts " <ul id=\"stock_steps\" style=\"display: none;\">" 37: steps.each do |step| 38: @output.puts " <li>#{step}</li>" 39: end 40: @output.puts " </ul>" 41: end 42: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 92 92: def found_scenario(type, description) 93: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 119 119: def print_step(klass, type, description, *args) 120: spans = args.map { |arg| "<span class=\"param\">#{arg}</span>" } 121: i = -1 122: inner = type.to_s.capitalize + ' ' + description.gsub(::Spec::Story::Step::PARAM_PATTERN) { |param| spans[i+=1] } 123: @output.puts " <li class=\"#{klass}\">#{inner}</li>" 124: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 44 44: def run_ended 45: @output.puts "</div>\n</body>\n</head>\n" 46: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 11 11: def run_started(count) 12: @output.puts "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html\nPUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n<title>Stories</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<meta http-equiv=\"Expires\" content=\"-1\" />\n<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n<script src=\"javascripts/prototype.js\" type=\"text/javascript\"></script>\n<script src=\"javascripts/scriptaculous.js\" type=\"text/javascript\"></script>\n<script src=\"javascripts/rspec.js\" type=\"text/javascript\"></script>\n<link href=\"stylesheets/rspec.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"container\">\n" 13: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 83 83: def scenario_ended 84: @output.puts "</ul>\n</dd>\n</dl>\n" 85: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 103 103: def scenario_failed(story_title, scenario_name, err) 104: scenario_ended 105: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 99 99: def scenario_pending(story_title, scenario_name, reason) 100: scenario_ended 101: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 73 73: def scenario_started(story_title, scenario_name) 74: @output.puts "<dl class=\"passed\">\n<dt>Scenario: \#{h scenario_name}</dt>\n<dd>\n<ul class=\"steps\">\n" 75: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 95 95: def scenario_succeeded(story_title, scenario_name) 96: scenario_ended 97: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 115 115: def step_failed(type, description, *args) 116: print_step('failed', type, description, *args) 117: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 111 111: def step_pending(type, description, *args) 112: print_step('pending', type, description, *args) 113: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 107 107: def step_succeeded(type, description, *args) 108: print_step('passed', type, description, *args) # TODO: uses succeeded CSS class 109: end
# File lib/spec/runner/formatter/story/html_formatter.rb, line 65 65: def story_ended(title, narrative) 66: @output.puts "</dd>\n</dl>\n" 67: end