From 4ba5f97fd8aaf299289d61a1b1790a8f7755489e Mon Sep 17 00:00:00 2001 From: Billy Kong Date: Mon, 13 Apr 2020 11:49:48 +0800 Subject: [PATCH] Assertion for EntryFilter#glob_include? _not_dir case --- test/_glob_include_test/{ => _is_dir}/include_me.txt | 0 test/_glob_include_test/_not_dir | 0 test/test_entry_filter.rb | 9 ++++----- 3 files changed, 4 insertions(+), 5 deletions(-) rename test/_glob_include_test/{ => _is_dir}/include_me.txt (100%) create mode 100644 test/_glob_include_test/_not_dir diff --git a/test/_glob_include_test/include_me.txt b/test/_glob_include_test/_is_dir/include_me.txt similarity index 100% rename from test/_glob_include_test/include_me.txt rename to test/_glob_include_test/_is_dir/include_me.txt diff --git a/test/_glob_include_test/_not_dir b/test/_glob_include_test/_not_dir new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/test_entry_filter.rb b/test/test_entry_filter.rb index 1018f089b2d..54f7c35d750 100644 --- a/test/test_entry_filter.rb +++ b/test/test_entry_filter.rb @@ -151,11 +151,10 @@ class TestEntryFilter < JekyllUnitTest end should "match directory only if there is trailing slash" do - data = ["../_glob_include_test/", "_not_dir/"] - assert @filter.glob_include?(data, "../_glob_include_test") - assert @filter.glob_include?(data, "../_glob_include_test/include_me.txt") - assert !@filter.glob_include?(data, "../_not_dir") + data = ["../_glob_include_test/_is_dir/", "../_glob_include_test/_not_dir/"] + assert @filter.glob_include?(data, "../_glob_include_test/_is_dir") + assert @filter.glob_include?(data, "../_glob_include_test/_is_dir/include_me.txt") + assert !@filter.glob_include?(data, "../_glob_include_test/_not_dir") end - end end