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
|
@ -5,7 +5,3 @@ authors:
|
||||||
- Jerome Gravel-Niquet <jeromegn@gmail.com>
|
- Jerome Gravel-Niquet <jeromegn@gmail.com>
|
||||||
|
|
||||||
license: MIT
|
license: MIT
|
||||||
|
|
||||||
development_dependencies:
|
|
||||||
slang:
|
|
||||||
github: jeromegn/slang
|
|
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
|
describe Kilt do
|
||||||
|
|
||||||
it "renders ecr" 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
|
end
|
||||||
|
|
||||||
it "renders slang" do
|
it "renders registered engine" do
|
||||||
render_file("spec/fixtures/test.slang").should eq("<span>#{Process.pid}</span>")
|
Kilt.register_engine "raw", Raw.embed
|
||||||
|
Kilt.render("spec/fixtures/test.raw").should eq("Hello World!")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "works with classes" do
|
it "works with classes" do
|
||||||
|
@ -20,7 +21,7 @@ describe Kilt do
|
||||||
|
|
||||||
it "raises with unsupported filetype" do
|
it "raises with unsupported filetype" do
|
||||||
expect_raises(Kilt::Exception, "Unsupported template engine for extension: \"abc\"") {
|
expect_raises(Kilt::Exception, "Unsupported template engine for extension: \"abc\"") {
|
||||||
render_file("test.abc")
|
Kilt.render("test.abc")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
require "spec"
|
require "spec"
|
||||||
require "../src/kilt"
|
require "../src/kilt"
|
||||||
|
|
||||||
require "slang"
|
module Raw
|
||||||
Kilt.register_engine("slang", embed_slang)
|
macro embed(filename, io)
|
||||||
|
{{ io.id }} << {{`cat #{filename}`.stringify}}
|
||||||
macro render_file(filename)
|
|
||||||
String.build do |__io__|
|
|
||||||
Kilt.embed({{filename}}, "__io__")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,3 +1,3 @@
|
||||||
module Kilt
|
module Kilt
|
||||||
VERSION = "0.2.0"
|
VERSION = "0.2.1"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue