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

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

View file

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

View file

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