mirror of
https://gitea.invidious.io/iv-org/shard-kilt.git
synced 2024-08-15 00:43:15 +00:00
27 lines
583 B
Crystal
27 lines
583 B
Crystal
require "./spec_helper"
|
|
|
|
class View
|
|
Kilt.file "spec/fixtures/test.ecr"
|
|
end
|
|
|
|
describe Kilt do
|
|
|
|
it "renders ecr" do
|
|
render_file("spec/fixtures/test.ecr").should eq("<span>#{Process.pid}</span>")
|
|
end
|
|
|
|
it "renders slang" do
|
|
render_file("spec/fixtures/test.slang").should eq("<span>#{Process.pid}</span>")
|
|
end
|
|
|
|
it "works with classes" do
|
|
View.new.to_s.should eq("<span>#{Process.pid}</span>")
|
|
end
|
|
|
|
it "raises with unsupported filetype" do
|
|
expect_raises(Kilt::Exception, "Unsupported template type \"abc\"") {
|
|
render_file("test.abc")
|
|
}
|
|
end
|
|
|
|
end
|