Add tests for new exclude behaviour.

This commit is contained in:
Parker Moore 2014-01-05 11:01:51 -08:00
parent 35868807c1
commit 366f9268ee
2 changed files with 8 additions and 2 deletions

View File

@ -83,6 +83,12 @@ class TestCoreExt < Test::Unit::TestCase
assert data.glob_include?("c/a/a.txt") assert data.glob_include?("c/a/a.txt")
assert data.glob_include?("c/a/b/a.txt") assert data.glob_include?("c/a/b/a.txt")
end end
should "match even if there is no leading slash" do
data = ['vendor/bundle']
assert data.glob_include?('/vendor/bundle')
assert data.glob_include?('vendor/bundle')
end
end end
end end
end end

View File

@ -18,8 +18,8 @@ class TestEntryFilter < Test::Unit::TestCase
end end
should "filter entries with exclude" do should "filter entries with exclude" do
excludes = %w[README TODO] excludes = %w[README TODO vendor/bundle]
files = %w[index.html site.css .htaccess] files = %w[index.html site.css .htaccess vendor]
@site.exclude = excludes + ["exclude*"] @site.exclude = excludes + ["exclude*"]
assert_equal files, @site.filter_entries(excludes + files + ["excludeA"]) assert_equal files, @site.filter_entries(excludes + files + ["excludeA"])