Class: Compatriot::Reporter
- Inherits:
-
Object
- Object
- Compatriot::Reporter
- Defined in:
- lib/compatriot/reporter.rb
Instance Attribute Summary collapse
-
#tests ⇒ Object
Returns the value of attribute tests.
Instance Method Summary collapse
-
#initialize(tests) ⇒ Reporter
constructor
A new instance of Reporter.
- #run ⇒ Object
Constructor Details
#initialize(tests) ⇒ Reporter
Returns a new instance of Reporter.
7 8 9 |
# File 'lib/compatriot/reporter.rb', line 7 def initialize(tests) @tests = tests end |
Instance Attribute Details
#tests ⇒ Object
Returns the value of attribute tests.
5 6 7 |
# File 'lib/compatriot/reporter.rb', line 5 def tests @tests end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/compatriot/reporter.rb', line 11 def run $tests = tests.sort_by {|t| (t.passed? ? 1 : 0) } file_path = File.('../report_template.html.haml', __FILE__) template = File.read(file_path) engine = Haml::Engine.new(template) File.write 'compatriot_report.html',engine.render end |