mirror of
https://gitea.invidious.io/iv-org/shard-kilt.git
synced 2024-08-15 00:43:15 +00:00
don't test with slang
This commit is contained in:
parent
8fb4bd73f8
commit
a222267254
6 changed files with 12 additions and 18 deletions
|
@ -4,8 +4,4 @@ version: 0.1.0
|
|||
authors:
|
||||
- Jerome Gravel-Niquet <jeromegn@gmail.com>
|
||||
|
||||
license: MIT
|
||||
|
||||
development_dependencies:
|
||||
slang:
|
||||
github: jeromegn/slang
|
||||
license: MIT
|
1
spec/fixtures/test.raw
vendored
Normal file
1
spec/fixtures/test.raw
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
Hello World!
|
1
spec/fixtures/test.slang
vendored
1
spec/fixtures/test.slang
vendored
|
@ -1 +0,0 @@
|
|||
span = Process.pid
|
|
@ -7,11 +7,12 @@ end
|
|||
describe Kilt do
|
||||
|
||||
it "renders ecr" do
|
||||
render_file("spec/fixtures/test.ecr").should eq("<span>#{Process.pid}</span>")
|
||||
Kilt.render("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>")
|
||||
it "renders registered engine" do
|
||||
Kilt.register_engine "raw", Raw.embed
|
||||
Kilt.render("spec/fixtures/test.raw").should eq("Hello World!")
|
||||
end
|
||||
|
||||
it "works with classes" do
|
||||
|
@ -20,7 +21,7 @@ describe Kilt do
|
|||
|
||||
it "raises with unsupported filetype" do
|
||||
expect_raises(Kilt::Exception, "Unsupported template engine for extension: \"abc\"") {
|
||||
render_file("test.abc")
|
||||
Kilt.render("test.abc")
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
require "spec"
|
||||
require "../src/kilt"
|
||||
|
||||
require "slang"
|
||||
Kilt.register_engine("slang", embed_slang)
|
||||
|
||||
macro render_file(filename)
|
||||
String.build do |__io__|
|
||||
Kilt.embed({{filename}}, "__io__")
|
||||
module Raw
|
||||
macro embed(filename, io)
|
||||
{{ io.id }} << {{`cat #{filename}`.stringify}}
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,3 +1,3 @@
|
|||
module Kilt
|
||||
VERSION = "0.2.0"
|
||||
VERSION = "0.2.1"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue