Module: RSpec::Clone::Console Private

Defined in:
lib/r_spec/clone/console.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 colored message.

See Also:


21
22
23
# File 'lib/r_spec/clone/console.rb', line 21

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/console.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.


33
34
35
# File 'lib/r_spec/clone/console.rb', line 33

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