mirror of
https://gitea.invidious.io/iv-org/shard-kilt.git
synced 2024-08-15 00:43:15 +00:00
Added slang adapter + specs, reorganized specs and adapters
This commit is contained in:
parent
ae9e097221
commit
b152bf1153
14 changed files with 62 additions and 27 deletions
26
spec/kilt/crustache_spec.cr
Normal file
26
spec/kilt/crustache_spec.cr
Normal file
|
@ -0,0 +1,26 @@
|
|||
require "../spec_helper"
|
||||
require "../../src/kilt/crustache"
|
||||
|
||||
class MustacheView
|
||||
def has_key?(name)
|
||||
name == "pid"
|
||||
end
|
||||
|
||||
def [](name)
|
||||
name == "pid" ? Process.pid : nil
|
||||
end
|
||||
|
||||
Kilt.file "spec/fixtures/test.mustache", "__kilt_io__", self
|
||||
end
|
||||
|
||||
describe "kilt/crustache" do
|
||||
|
||||
it "renders crustache" do
|
||||
Kilt.render("spec/fixtures/test.mustache", { "pid" => Process.pid }).should eq("<span>#{Process.pid}</span>")
|
||||
end
|
||||
|
||||
it "works with classes" do
|
||||
MustacheView.new.to_s.should eq("<span>#{Process.pid}</span>")
|
||||
end
|
||||
|
||||
end
|
18
spec/kilt/slang_spec.cr
Normal file
18
spec/kilt/slang_spec.cr
Normal file
|
@ -0,0 +1,18 @@
|
|||
require "../spec_helper"
|
||||
require "../../src/kilt/slang"
|
||||
|
||||
class SlangView
|
||||
Kilt.file "spec/fixtures/test.slang"
|
||||
end
|
||||
|
||||
describe "kilt/slang" do
|
||||
|
||||
it "renders slang" do
|
||||
Kilt.render("spec/fixtures/test.slang").should eq("<span>#{Process.pid}</span>")
|
||||
end
|
||||
|
||||
it "works with classes" do
|
||||
SlangView.new.to_s.should eq("<span>#{Process.pid}</span>")
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue