add test to ensure where doesn't match substrings

This commit is contained in:
timwis 2016-03-03 15:56:54 -05:00
parent f5f8548eb8
commit e130a0841f
1 changed files with 5 additions and 0 deletions

View File

@ -316,6 +316,11 @@ class TestFilters < JekyllUnitTest
assert_equal 2, @filter.where(hash, "tags", "x").length
end
should "not match substrings" do
hash = {"a"=>{"category"=>"bear"}, "b"=>{"category"=>"wolf"}, "c"=>{"category"=>["bear","lion"]}}
assert_equal 0, @filter.where(hash, "category", "ear").length
end
should "stringify during comparison for compatibility with liquid parsing" do
hash = {
"The Words" => {"rating" => 1.2, "featured" => false},