Class: Simplexframe::SimplexframeFormatter
- Inherits:
-
RSpec::Core::Formatters::HtmlFormatter
- Object
- RSpec::Core::Formatters::HtmlFormatter
- Simplexframe::SimplexframeFormatter
- Defined in:
- lib/simplexframe/generators/simplexframe/config/simplexframe_formatter.rb
Instance Method Summary collapse
- #example_failed(example) ⇒ Object
-
#initialize(output) ⇒ SimplexframeFormatter
constructor
A new instance of SimplexframeFormatter.
Constructor Details
#initialize(output) ⇒ SimplexframeFormatter
Returns a new instance of SimplexframeFormatter.
6 7 8 9 10 11 12 |
# File 'lib/simplexframe/generators/simplexframe/config/simplexframe_formatter.rb', line 6 def initialize(output) output = File.new(File.(File.join('.', 'app', 'reports', "#{Time.now.strftime("%Y%m%d_%H%M%S")}.html")), 'w') super(output) @printer.class.send(:define_method, 'puts') do |what| @output.puts what end #define_method end |
Instance Method Details
#example_failed(example) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/simplexframe/generators/simplexframe/config/simplexframe_formatter.rb', line 14 def example_failed(example) super(example) if $navi failed_url = $navi.url rescue $navi.current_url @printer.puts "<a target=\"_blank\" href=\"#{failed_url}\">failed url is [#{failed_url}]</a>" @printer.puts '<br />' @printer.flush end #if end |