1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-12-02 15:27:47 +01:00
gojekyll/site/dependencies_test.go

42 lines
1.2 KiB
Go
Raw Normal View History

2017-08-24 18:23:40 +02:00
package site
import (
"testing"
"github.com/osteele/gojekyll/config"
"github.com/stretchr/testify/require"
)
//func TestSite_WatchRebuild(t *testing.T) {
func TestSite_Reloaded(t *testing.T) {
s0 := New(config.Flags{})
2017-08-24 18:25:38 +02:00
s0.cfg.Incremental = true
2017-08-24 18:23:40 +02:00
s1, _ := s0.Reloaded([]string{})
require.Equal(t, s0, s1)
s1, _ = s0.Reloaded([]string{"_config.yml"})
require.NotEqual(t, s0, s1)
}
//func TestSite_processFilesEvent(t *testing.T) {
//func TestSite_rebuild(t *testing.T) {
func TestSite_RequiresFullReload(t *testing.T) {
s := New(config.Flags{})
require.False(t, s.RequiresFullReload([]string{}))
require.True(t, s.RequiresFullReload([]string{"file.md"}))
require.False(t, s.RequiresFullReload([]string{".git"}))
// require.False(t, s.RequiresFullReload([]string{"_site"}))
// require.False(t, s.RequiresFullReload([]string{"_site/index.html"}))
2017-08-24 18:25:38 +02:00
s.cfg.Incremental = true
2017-08-24 18:23:40 +02:00
require.False(t, s.RequiresFullReload([]string{}))
require.False(t, s.RequiresFullReload([]string{"file.md"}))
require.True(t, s.RequiresFullReload([]string{"_config.yml"}))
}
//func TestSite_affectsBuildFilter(t *testing.T) {
//func TestSite_fileAffectsBuild(t *testing.T) {
//func TestSite_invalidatesDoc(t *testing.T) {