Sha256: 3d881c7fd226c3bde696f06156c8d5972eb8ab62f2122f66c370a858c30635b9

Contents?: true

Size: 866 Bytes

Versions: 15

Compression:

Stored size: 866 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'test/unit'
require 'helper'
require 'webgen/source'

class TestSourceResource < Test::Unit::TestCase

  include Test::WebsiteHelper

  def test_initialize
    source = Webgen::Source::Resource.new('test-glob-*')
    assert_equal('test-glob-*', source.glob)
  end

  def test_paths
    @website.config['resources']['test-resource'] = ['Webgen::Source::FileSystem', '.', File.basename(__FILE__)]
    @website.config['resources']['other-resource'] = ['Webgen::Source::FileSystem', '../lib']

    source = Webgen::Source::Resource.new('test-*')
    assert_equal(1, source.paths.length)
    assert(source.paths.include?(Webgen::Path.new('/test_source_resource.rb')))

    source = Webgen::Source::Resource.new('other-*', '/webgen/**/*', '/webgen/')
    assert(source.paths.include?(Webgen::Path.new('/source/resource.rb')))
  end

end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
gettalong-webgen-0.5.7.20090227 test/test_source_resource.rb
gettalong-webgen-0.5.8.20090507 test/test_source_resource.rb
gettalong-webgen-0.5.9.20090620 test/test_source_resource.rb
gettalong-webgen-0.5.9.20090626 test/test_source_resource.rb
thewoolleyman-webgen-0.5.8.20090419 test/test_source_resource.rb
webgen-0.5.17 test/test_source_resource.rb
webgen-0.5.15 test/test_source_resource.rb
webgen-0.5.14 test/test_source_resource.rb
webgen-0.5.13 test/test_source_resource.rb
webgen-0.5.12 test/test_source_resource.rb
webgen-0.5.11 test/test_source_resource.rb
webgen-0.5.10 test/test_source_resource.rb
webgen-0.5.9 test/test_source_resource.rb
webgen-0.5.7 test/test_source_resource.rb
webgen-0.5.8 test/test_source_resource.rb