module RSpec::Clone::Console

Send log messages to the console.

Public Class Methods

failed_spec(report) click to toggle source

@param report [::Expresenter::Fail] Failed expectation result presenter.

@see github.com/fixrb/expresenter

@raise [SystemExit] Terminate execution immediately with colored message.

# File lib/r_spec/clone/console.rb, line 21
def self.failed_spec(report)
  abort report.colored_string
end
passed_spec(report) click to toggle source

@param report [::Expresenter::Pass] Passed expectation result presenter.

@see github.com/fixrb/expresenter

@return [nil] Add a colored message to `$stdout`.

# File lib/r_spec/clone/console.rb, line 12
def self.passed_spec(report)
  puts report.colored_string
end
source(filename, line) click to toggle source

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

@param filename [String, nil] The Ruby source filename. @param line [Integer, nil] The Ruby source line number.

@return [String] The Ruby source filename and line number associated with

the evaluated spec.
# File lib/r_spec/clone/console.rb, line 33
def self.source(filename, line)
  puts [filename, line].compact.join(":")
end