@@ -19,7 +19,62 @@ describe Crustache do
1919
2020 describe " #parse_file" do
2121 it " should parse a file" do
22- Crustache .parse_file(" #{ __DIR__ } /view/template.mustache" ).should be_truthy
22+ tmpl = Crustache .parse_file(" #{ __DIR__ } /view/template.mustache" )
23+ tmpl.should be_a Crustache ::Template
24+ end
25+ end
26+
27+ describe " #parse_file_static" do
28+ it " should parse a file on compile time" do
29+ tmpl = Crustache .parse_file_static(" #{ __DIR__ } /view/template.mustache" )
30+ tmpl.should be_a Crustache ::Template
31+ end
32+ end
33+
34+ describe " #loader" do
35+ it " should create loader object" do
36+ loader = Crustache .loader " #{ __DIR__ } /view/"
37+
38+ loader.load(" template" ).should be_a Crustache ::Template
39+ loader.load(" template.mustache" ).should be_a Crustache ::Template
40+ loader.load(" template_html" ).should be_a Crustache ::Template
41+ loader.load(" template_html.html" ).should be_a Crustache ::Template
42+ loader.load(" template_test" ).should be_a Crustache ::Template
43+ loader.load(" template_test.html" ).should be_a Crustache ::Template
44+ end
45+
46+ it " should create loader object" do
47+ loader = Crustache .loader " #{ __DIR__ } /view"
48+
49+ loader.load(" template" ).should be_a Crustache ::Template
50+ loader.load(" template.mustache" ).should be_a Crustache ::Template
51+ loader.load(" template_html" ).should be_a Crustache ::Template
52+ loader.load(" template_html.html" ).should be_a Crustache ::Template
53+ loader.load(" template_test" ).should be_a Crustache ::Template
54+ loader.load(" template_test.html" ).should be_a Crustache ::Template
55+ end
56+ end
57+ describe " #loader_static" do
58+ it " should create loader object on compile time" do
59+ loader = Crustache .loader_static " #{ __DIR__ } /view/"
60+
61+ loader.load(" template" ).should be_a Crustache ::Template
62+ loader.load(" template.mustache" ).should be_a Crustache ::Template
63+ loader.load(" template_html" ).should be_a Crustache ::Template
64+ loader.load(" template_html.html" ).should be_a Crustache ::Template
65+ loader.load(" template_test" ).should be_a Crustache ::Template
66+ loader.load(" template_test.html" ).should be_a Crustache ::Template
67+ end
68+
69+ it " should create loader object on compile time" do
70+ loader = Crustache .loader_static " #{ __DIR__ } /view"
71+
72+ loader.load(" template" ).should be_a Crustache ::Template
73+ loader.load(" template.mustache" ).should be_a Crustache ::Template
74+ loader.load(" template_html" ).should be_a Crustache ::Template
75+ loader.load(" template_html.html" ).should be_a Crustache ::Template
76+ loader.load(" template_test" ).should be_a Crustache ::Template
77+ loader.load(" template_test.html" ).should be_a Crustache ::Template
2378 end
2479 end
2580
0 commit comments