Module: RSpec::Clone::Logger Private

Defined in:
lib/r_spec/clone/logger.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Send log messages to the console.

Class Method Summary collapse

Class Method Details

.failed_spec(report) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • report (::Expresenter::Fail)

    Failed expectation result presenter.

Raises:

  • (SystemExit)

    Terminate execution immediately with message.

See Also:



23
24
25
# File 'lib/r_spec/clone/logger.rb', line 23

def self.failed_spec(report)
  abort report.colored_string
end

.passed_spec(report) ⇒ nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns Add a colored message to ‘$stdout`.

Parameters:

  • report (::Expresenter::Pass)

    Passed expectation result presenter.

Returns:

  • (nil)

    Add a colored message to ‘$stdout`.

See Also:



12
13
14
# File 'lib/r_spec/clone/logger.rb', line 12

def self.passed_spec(report)
  puts report.colored_string
end

.source(filename, line) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The Ruby source filename and line number containing this method or nil if this method was not defined in Ruby (i.e. native).

Parameters:

  • filename (String, nil)

    The Ruby source filename.

  • line (Integer, nil)

    The Ruby source line number.

Returns:

  • (String)

    The Ruby source filename and line number associated with the evaluated spec.



37
38
39
# File 'lib/r_spec/clone/logger.rb', line 37

def self.source(filename, line)
  puts [filename, line].compact.join(":")
end