Class: Lazyman::LazymanFormatter
- Inherits:
-
RSpec::Core::Formatters::HtmlFormatter
- Object
- RSpec::Core::Formatters::HtmlFormatter
- Lazyman::LazymanFormatter
- Defined in:
- lib/lazyman/generators/lazyman/config/lazyman_formatter.rb
Instance Method Summary collapse
- #example_failed(example) ⇒ Object
-
#initialize(output) ⇒ LazymanFormatter
constructor
A new instance of LazymanFormatter.
Constructor Details
#initialize(output) ⇒ LazymanFormatter
Returns a new instance of LazymanFormatter.
6 7 8 9 10 11 12 |
# File 'lib/lazyman/generators/lazyman/config/lazyman_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/lazyman/generators/lazyman/config/lazyman_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 |