Sha256: bbea6a42e963dd925874c59da378d75ab5d8d4a5111145c7f2bd6d10deca8dce

Contents?: true

Size: 418 Bytes

Versions: 1

Compression:

Stored size: 418 Bytes

Contents

module Assert

  class ContextInfo

    attr_reader :called_from, :klass, :file

    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

    def test_name(name)
      [klass.description.to_s, name.to_s].compact.reject(&:empty?).join(" ")
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
assert-2.17.0 lib/assert/context_info.rb