/
githubmirror
/
jekyll
Обзор
Документация
Войти
/
githubmirror
/
jekyll
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/test_publisher.rb
42 строки
1 KB
Mike Dalton
Allow configuring future metadata for individual collections (#9925)
11 мар 2026, 18:39
Не верифицирован
11 мар 2026, 18:39
f07d4f7
Код
Авторство
О чём код?
# frozen_string_literal: true require "helper" class TestPublisher < JekyllUnitTest context "default configuration" do setup do site = fixture_site collection = Jekyll::Collection.new(site, "methods") @thing = Jekyll::Document.new( source_dir("methods/method.md"), :site => site, :collection => collection ) @thing.data["date"] = (Time.now + (60 * 60 * 24)).to_i # tomorrow @publisher = Jekyll::Publisher.new(site) end should "be hidden in the future" do assert @publisher.hidden_in_the_future?(@thing) end end context "when a thing's collection is configured to show future posts" do setup do site = fixture_site collection = Jekyll::Collection.new(site, "methods") collection.metadata["future"] = true @thing = Jekyll::Document.new( source_dir("methods/method.md"), :site => site, :collection => collection ) @thing.data["date"] = (Time.now + (60 * 60 * 24)).to_i # tomorrow @publisher = Jekyll::Publisher.new(site) end should "not be hidden in the future" do refute @publisher.hidden_in_the_future?(@thing) end end end