Class: Lazyman::LazymanFormatter

Inherits:
RSpec::Core::Formatters::HtmlFormatter
  • Object
show all
Defined in:
lib/lazyman/generators/lazyman/config/lazyman_formatter.rb

Instance Method Summary collapse

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.expand_path(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