Class: TeamCityFormatter::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/teamcity_formatter/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ Logger

Returns a new instance of Logger.



3
4
5
# File 'lib/teamcity_formatter/logger.rb', line 3

def initialize(io)
  @io = io
end

Instance Method Details

#test_failed(test_name, details) ⇒ Object



24
25
26
# File 'lib/teamcity_formatter/logger.rb', line 24

def test_failed(test_name, details)
  render_output("##teamcity[testFailed name='#{teamcity_escape(test_name)}' timestamp='#{timestamp}' details='#{teamcity_escape(details)}']")
end

#test_failed_with_exception(test_name, exception) ⇒ Object



19
20
21
22
# File 'lib/teamcity_formatter/logger.rb', line 19

def test_failed_with_exception(test_name, exception)
  details = format_exception(exception)
  test_failed(test_name, details)
end

#test_finished(test_name) ⇒ Object



28
29
30
# File 'lib/teamcity_formatter/logger.rb', line 28

def test_finished(test_name)
  render_output("##teamcity[testFinished name='#{teamcity_escape(test_name)}' timestamp='#{timestamp}']")
end

#test_started(test_name) ⇒ Object



15
16
17
# File 'lib/teamcity_formatter/logger.rb', line 15

def test_started(test_name)
  render_output("##teamcity[testStarted name='#{teamcity_escape(test_name)}' timestamp='#{timestamp}' captureStandardOutput='true']")
end

#test_suite_finished(test_suite_name) ⇒ Object



11
12
13
# File 'lib/teamcity_formatter/logger.rb', line 11

def test_suite_finished(test_suite_name)
  render_output("##teamcity[testSuiteFinished name='#{teamcity_escape(test_suite_name)}' timestamp='#{timestamp}']")
end

#test_suite_started(test_suite_name) ⇒ Object



7
8
9
# File 'lib/teamcity_formatter/logger.rb', line 7

def test_suite_started(test_suite_name)
  render_output("##teamcity[testSuiteStarted name='#{teamcity_escape(test_suite_name)}' timestamp='#{timestamp}']")
end