class Rproof::LocatedInfo

Attributes

file[R]
line[R]
method[R]
pathname[R]

Public Class Methods

new() click to toggle source
# File lib/rproof/located_info.rb, line 9
def initialize
  @pathname = nil
  @file = nil
  @line = nil
  @method = nil
  caller.each do |line|
    matches = line.match /^.*\.rb/
    pathname = Pathname.new(matches[0])
    if not pathname.to_s.match(/lib\/(censor)|(assertion)|(warning)\.rb$/) and nil == @file # ignore lib files, until test definition file
      @pathname = pathname
      @file = pathname.basename
      matches = line.match /^.*\.rb:(\d*):in `([^']*)'/
      @line = matches[1]
      @method = matches[2]
    end
  end
end