Sha256: 093d560a10ac8c0fb017a70763f5de371c3a77a7264d9fd7b2086574c4b4f43b

Contents?: true

Size: 552 Bytes

Versions: 6

Compression:

Stored size: 552 Bytes

Contents

require 'wlang/template'

#
# Provides some test utilities
#
module WLang::TestUtils
  
  # Returns a relative file
  def relative_file(name, from=__FILE__)
    File.join(File.dirname(from), name)
  end
  
  # Returns a relative file
  def read_relative_file(name, from=__FILE__)
    File.read(File.join(File.dirname(from), name))
  end
  
  # Factors a template and fakes its source-file as from
  def relative_template(src, dialect, from=__FILE__)
    template = WLang::template(src, dialect)
    template.source_file = from
    template
  end
  
end

Version data entries

6 entries across 5 versions & 1 rubygems

Version Path
wlang-0.10.2 test/unit/wlang/test_utils.rb
wlang-0.10.1 ./test/unit/wlang/test_utils.rb
wlang-0.10.1 test/unit/wlang/test_utils.rb
wlang-0.10.0 test/unit/wlang/test_utils.rb
wlang-0.9.2 test/unit/wlang/test_utils.rb
wlang-0.9.1 test/unit/wlang/test_utils.rb