-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload_test.go
More file actions
29 lines (21 loc) · 784 Bytes
/
load_test.go
File metadata and controls
29 lines (21 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package html
import . "github.com/101loops/bdd"
var _ = Describe("Loader", func() {
It("load template files", func() {
conf := Config{Directories: []string{"fixtures"}}
loader, err := NewLoader(conf)
Check(err, IsNil)
Check(loader, NotNil)
Check(loader.Sources(), HasLen, 14)
loader.AddFile("my-layout", "layout.html")
loader.AddText("my-content", "<h1>My Content</h1>")
Check(loader.Sources(), HasLen, 16)
Check(loader.Sources(), Contains, &Source{Name: "my-layout", FilePath: "layout.html"})
Check(loader.Sources(), Contains, &Source{Name: "my-content", Content: "<h1>My Content</h1>"})
})
It("unable to load non-existent directory", func() {
conf := Config{Directories: []string{"nonsense"}}
_, err := NewLoader(conf)
Check(err, NotNil)
})
})