don't test with slang

This commit is contained in:
Jerome Gravel-Niquet 2016-02-14 22:36:55 -05:00
parent 8fb4bd73f8
commit a222267254
6 changed files with 12 additions and 18 deletions

View file

@ -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
View file

@ -0,0 +1 @@
Hello World!

View file

@ -1 +0,0 @@
span = Process.pid

View file

@ -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

View file

@ -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

View file

@ -1,3 +1,3 @@
module Kilt
VERSION = "0.2.0"
VERSION = "0.2.1"
end