class Assert::ContextInfo

Attributes

called_from[R]
file[R]
klass[R]

Public Class Methods

new(klass, called_from = nil, first_caller = nil) click to toggle source
# File lib/assert/context_info.rb, line 7
def initialize(klass, called_from = nil, first_caller = nil)
  @called_from = called_from || first_caller
  @klass = klass
  @file = @called_from.to_s.gsub(/\:[0-9]+.*$/, "") if @called_from
end

Public Instance Methods

test_name(name) click to toggle source
# File lib/assert/context_info.rb, line 13
def test_name(name)
  [klass.description.to_s, name.to_s].compact.reject(&:empty?).join(" ")
end