malt 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby +156 -0
- data/Assembly +28 -0
- data/COPYING.rdoc +33 -0
- data/Gemfile +10 -0
- data/HISTORY.rdoc +102 -0
- data/README.rdoc +16 -10
- data/Reapfile +4 -0
- data/lib/malt.rb +36 -8
- data/lib/malt.yml +156 -0
- data/lib/malt/conversions.rb +42 -0
- data/lib/malt/core_ext.rb +81 -3
- data/lib/malt/engines/abstract.rb +259 -50
- data/lib/malt/engines/bluecloth.rb +19 -9
- data/lib/malt/engines/builder.rb +93 -32
- data/lib/malt/engines/coffee.rb +46 -0
- data/lib/malt/engines/creole.rb +60 -0
- data/lib/malt/engines/erb.rb +69 -44
- data/lib/malt/engines/erector.rb +61 -30
- data/lib/malt/engines/erubis.rb +41 -31
- data/lib/malt/engines/haml.rb +13 -37
- data/lib/malt/engines/kramdown.rb +40 -15
- data/lib/malt/engines/less.rb +15 -14
- data/lib/malt/engines/liquid.rb +24 -14
- data/lib/malt/engines/markaby.rb +44 -22
- data/lib/malt/engines/maruku.rb +89 -0
- data/lib/malt/engines/mustache.rb +20 -14
- data/lib/malt/engines/nokogiri.rb +89 -0
- data/lib/malt/engines/radius.rb +72 -34
- data/lib/malt/engines/ragtag.rb +26 -18
- data/lib/malt/engines/rdiscount.rb +18 -11
- data/lib/malt/engines/rdoc.rb +21 -15
- data/lib/malt/engines/redcarpet.rb +137 -0
- data/lib/malt/engines/redcloth.rb +15 -7
- data/lib/malt/engines/ruby.rb +13 -12
- data/lib/malt/engines/sass.rb +30 -17
- data/lib/malt/engines/string.rb +36 -0
- data/lib/malt/engines/tenjin.rb +70 -27
- data/lib/malt/engines/wikicloth.rb +48 -0
- data/lib/malt/formats/abstract.rb +90 -29
- data/lib/malt/formats/abstract_template.rb +10 -8
- data/lib/malt/formats/builder.rb +39 -13
- data/lib/malt/formats/coffee.rb +54 -0
- data/lib/malt/formats/css.rb +3 -3
- data/lib/malt/formats/erb.rb +31 -66
- data/lib/malt/formats/haml.rb +8 -8
- data/lib/malt/formats/html.rb +1 -7
- data/lib/malt/formats/javascript.rb +27 -0
- data/lib/malt/formats/latex.rb +1 -1
- data/lib/malt/formats/less.rb +13 -11
- data/lib/malt/formats/liquid.rb +7 -7
- data/lib/malt/formats/markdown.rb +43 -44
- data/lib/malt/formats/mediawiki.rb +70 -0
- data/lib/malt/formats/mustache.rb +5 -5
- data/lib/malt/formats/pdf.rb +1 -7
- data/lib/malt/formats/radius.rb +5 -4
- data/lib/malt/formats/ragtag.rb +14 -13
- data/lib/malt/formats/rbhtml.rb +28 -20
- data/lib/malt/formats/rdoc.rb +5 -4
- data/lib/malt/formats/rhtml.rb +19 -43
- data/lib/malt/formats/ruby.rb +11 -45
- data/lib/malt/formats/sass.rb +16 -24
- data/lib/malt/formats/scss.rb +13 -30
- data/lib/malt/formats/string.rb +61 -0
- data/lib/malt/formats/tenjin.rb +4 -4
- data/lib/malt/formats/text.rb +1 -1
- data/lib/malt/formats/textile.rb +7 -19
- data/lib/malt/kernel.rb +1 -2
- data/lib/malt/machine.rb +83 -13
- data/lib/malt/tilted.rb +216 -0
- data/lib/malt/version.rb +21 -0
- data/test/helper.rb +15 -0
- data/test/unit/engines/case_engine_bluecloth.rb +40 -0
- data/test/unit/engines/case_engine_builder.rb +30 -0
- data/test/unit/engines/case_engine_coffee.rb +30 -0
- data/test/unit/engines/case_engine_creole.rb +35 -0
- data/test/unit/engines/case_engine_erb.rb +28 -0
- data/test/unit/engines/case_engine_erector.rb +36 -0
- data/test/unit/engines/case_engine_erubis.rb +28 -0
- data/test/unit/engines/case_engine_haml.rb +30 -0
- data/test/unit/engines/case_engine_kramdown.rb +30 -0
- data/test/unit/engines/case_engine_less.rb +40 -0
- data/test/unit/engines/case_engine_liquid.rb +28 -0
- data/test/unit/engines/case_engine_markaby.rb +20 -0
- data/test/unit/engines/case_engine_maruku.rb +30 -0
- data/test/unit/engines/case_engine_mustache.rb +28 -0
- data/test/unit/engines/case_engine_nokogiri.rb +30 -0
- data/test/unit/engines/case_engine_radius.rb +30 -0
- data/test/unit/engines/case_engine_ragtag.rb +40 -0
- data/test/unit/engines/case_engine_rdiscount.rb +30 -0
- data/test/unit/engines/case_engine_rdoc.rb +31 -0
- data/test/unit/engines/case_engine_redcarpet.rb +30 -0
- data/test/unit/engines/case_engine_redcloth.rb +31 -0
- data/test/unit/engines/case_engine_ruby.rb +28 -0
- data/test/unit/engines/case_engine_sass.rb +36 -0
- data/test/unit/engines/case_engine_string.rb +28 -0
- data/test/unit/engines/case_engine_tenjin.rb +28 -0
- data/test/unit/engines/case_engine_wikicloth.rb +25 -0
- data/test/unit/machine.rb +27 -0
- data/test/unit/malt.rb +12 -0
- metadata +364 -266
- data/History.rdoc +0 -64
- data/License.txt +0 -205
- data/Syckfile +0 -80
- data/features/consistent_rendering.feature +0 -36
- data/features/samples/sample.erb +0 -1
- data/features/samples/sample.erubis +0 -1
- data/features/samples/sample.liquid +0 -1
- data/features/samples/sample.mustache +0 -1
- data/features/samples/sample.radius +0 -1
- data/features/step_definitions/engine_steps.rb +0 -49
- data/features/support/loadpath.rb +0 -1
- data/features/support/sample_class.rb +0 -8
- data/lib/malt/formats/erector.rb +0 -53
- data/lib/malt/formats/markaby.rb +0 -53
- data/lib/malt/meta/data.rb +0 -26
- data/lib/malt/meta/package +0 -21
- data/lib/malt/meta/profile +0 -21
- data/meta/data.rb +0 -26
- data/meta/package +0 -21
- data/meta/profile +0 -21
- data/qed/01_overview.rdoc +0 -8
- data/qed/02_formats.rdoc +0 -39
- data/qed/03_formats/01_overview.rdoc +0 -7
- data/qed/03_formats/02_rdoc.rdoc +0 -83
- data/qed/03_formats/03_textile.rdoc +0 -48
- data/qed/03_formats/04_markdown.rdoc +0 -66
- data/qed/03_formats/05_erb.rdoc +0 -65
- data/qed/03_formats/06_liquid.rdoc +0 -54
- data/qed/03_formats/07_haml.rdoc +0 -44
- data/qed/03_formats/08_ragtag.rdoc +0 -19
- data/qed/03_formats/09_radius.rdoc +0 -43
- data/qed/03_formats/11_tenjin.rdoc +0 -47
- data/qed/03_formats/12_rbhtml.rdoc +0 -55
- data/qed/03_formats/13_sass.rdoc +0 -55
- data/qed/03_formats/14_scss.rdoc +0 -58
- data/qed/03_formats/15_less.rdoc +0 -46
- data/qed/03_formats/16_ruby.rdoc +0 -48
- data/qed/03_formats/17_markaby.rdoc +0 -50
- data/qed/03_formats/18_builder.rb +0 -50
- data/qed/03_formats/19_erector.rb +0 -50
- data/qed/03_formats/20_mustache.rdoc +0 -54
- data/qed/05_machine/01_limited_formats.rdoc +0 -29
- data/qed/05_machine/02_prioritized_engines.rdoc +0 -34
- data/qed/applique/malt.rb +0 -13
- data/qed/samples/data.yml +0 -4
- data/qed/samples/output-erb.txt +0 -1
- data/qed/samples/output-liquid.txt +0 -1
- data/qed/samples/output-mustache.txt +0 -1
- data/qed/samples/output-radius.txt +0 -1
- data/qed/samples/sample.erb +0 -1
- data/qed/samples/sample.liquid +0 -1
- data/qed/samples/sample.markdown +0 -308
- data/qed/samples/sample.mustache +0 -1
- data/qed/samples/sample.radius +0 -1
- data/qed/samples/sample.rdoc +0 -8
@@ -0,0 +1,28 @@
|
|
1
|
+
testcase Malt::Engine::Erubis do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert ERB text" do
|
6
|
+
e = Malt::Engine::Erubis.new(:text=>"<h1><%= title %></h1>")
|
7
|
+
h = e.render(:locals=>{:title=>'Testing'})
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "Erubis is converstion format agnostic" do
|
12
|
+
e = Malt::Engine::Erubis.new
|
13
|
+
e.render(:to=>:DNE, :text=>"<h1>Testing</h1>")
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
method :prepare_engine do
|
19
|
+
|
20
|
+
test "returns a Erubius::Eruby instance" do
|
21
|
+
e = Malt::Engine::Erubis.new
|
22
|
+
r = e.prepare_engine(:text=>"<h1><%= title %></h1>")
|
23
|
+
r.assert.is_a? ::Erubis::Eruby
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
testcase Malt::Engine::Haml do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert Haml DSL to XML by default" do
|
6
|
+
e = Malt::Engine::Haml.new(:text=>"%h1 Testing")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::Haml.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"%h1 Testing")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an ::Haml::Engine instance" do
|
23
|
+
e = Malt::Engine::Haml.new
|
24
|
+
r = e.prepare_engine(:text=>"%h1 Testing")
|
25
|
+
r.assert.is_a? ::Haml::Engine
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
testcase Malt::Engine::Kramdown do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert Kramdown text" do
|
6
|
+
e = Malt::Engine::Kramdown.new(:text=>"# Testing")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index %{<h1 id="testing">Testing</h1>}
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::Kramdown.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"# Testing")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an ::Kramdown instance" do
|
23
|
+
e = Malt::Engine::Kramdown.new
|
24
|
+
r = e.prepare_engine(:text=>"# Testing")
|
25
|
+
r.assert.is_a? ::Kramdown::Document
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
testcase Malt::Engine::Less do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert LESS to CSS" do
|
6
|
+
e = Malt::Engine::Less.new(:text=>"#menu {\n margin: 0; }")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "#menu {\n margin: 0;\n}\n"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::Less.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"#menu {\n margin: 0; }")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an Less::Tree instance" do
|
23
|
+
e = Malt::Engine::Less.new
|
24
|
+
r = e.prepare_engine(:text=>"#menu {\n margin: 0; }")
|
25
|
+
r.assert.is_a? ::Less::Tree
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
method :create_engine do
|
31
|
+
|
32
|
+
test "returns an Less::Tree instance" do
|
33
|
+
e = Malt::Engine::Less.new
|
34
|
+
r = e.create_engine(:text=>"#menu {\n margin: 0; }")
|
35
|
+
r.assert.is_a? ::Less::Tree
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
testcase Malt::Engine::Liquid do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert ERB text" do
|
6
|
+
e = Malt::Engine::Liquid.new(:text=>"<h1>{{ title }}</h1>")
|
7
|
+
h = e.render(:locals=>{:title=>'Testing'})
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "Liquid is converstion format agnostic" do
|
12
|
+
e = Malt::Engine::Liquid.new
|
13
|
+
e.render(:to=>:DNE, :text=>"<h1>{{ title }}</h1>")
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
method :prepare_engine do
|
19
|
+
|
20
|
+
test "returns a Liquid instance" do
|
21
|
+
e = Malt::Engine::Liquid.new
|
22
|
+
r = e.prepare_engine(:text=>"<h1>{{ title }}</h1>")
|
23
|
+
r.assert.is_a? ::Liquid::Template
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
testcase Malt::Engine::Markaby do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert Markaby DSL to XML by default" do
|
6
|
+
e = Malt::Engine::Markaby.new(:text=>%[h1 "Testing"])
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::Markaby.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>%[h1 "Testing"])
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
testcase Malt::Engine::Maruku do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert Maruku text" do
|
6
|
+
e = Malt::Engine::Maruku.new(:text=>"# Testing")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1 id='testing'>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::Maruku.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"# Testing")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an ::Maruku instance" do
|
23
|
+
e = Malt::Engine::Maruku.new
|
24
|
+
r = e.prepare_engine(:text=>"# Testing")
|
25
|
+
r.assert.is_a? ::Maruku
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
testcase Malt::Engine::Mustache do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "render text" do
|
6
|
+
e = Malt::Engine::Mustache.new(:text=>"<h1>{{ title }}</h1>")
|
7
|
+
h = e.render(:locals=>{:title=>'Testing'})
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "Mustache is converstion format agnostic" do
|
12
|
+
e = Malt::Engine::Mustache.new
|
13
|
+
e.render(:to=>:DNE, :text=>"<h1>{{ title }}</h1>")
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
#method :prepare_engine do
|
19
|
+
#
|
20
|
+
# test "returns a Mustache instance" do
|
21
|
+
# e = Malt::Engine::Mustache.new
|
22
|
+
# r = e.iprepare_engine(:text=>"<h1>{{ title }}</h1>")
|
23
|
+
# r.assert.is_a? ::Mustache
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
#end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
testcase Malt::Engine::Nokogiri do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert Nokogiri DSL to XML by default" do
|
6
|
+
e = Malt::Engine::Nokogiri.new(:text=>%[h1 "Testing"])
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::Nokogiri.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>%[h1 "Testing"])
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns a ::Nokogiri::XML::Builder instance" do
|
23
|
+
e = Malt::Engine::Nokogiri.new
|
24
|
+
r = e.prepare_engine(:text=>%[h1 "Testing"])
|
25
|
+
r.assert.is_a? ::Nokogiri::XML::Builder
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
testcase Malt::Engine::Radius do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert Radius DSL to XML by default" do
|
6
|
+
e = Malt::Engine::Radius.new(:text=>"<h1>Testing</h1>")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::Radius.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"<h1>Testing</h1>")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an instance of a subclass of ::Radius::Context" do
|
23
|
+
e = Malt::Engine::Radius.new
|
24
|
+
r = e.prepare_engine(:text=>"<h1>Testing</h1>")
|
25
|
+
r.assert.is_a? ::Radius::Context
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
testcase Malt::Engine::RagTag do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert RagTag DSL to XML by default" do
|
6
|
+
e = Malt::Engine::RagTag.new(:text=>"<h1>Testing</h1>")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::RagTag.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"<h1>Testing</h1>")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an ::Nokogiri document" do
|
23
|
+
e = Malt::Engine::RagTag.new
|
24
|
+
r = e.prepare_engine(:text=>"<h1>Testing</h1>")
|
25
|
+
r.assert.is_a? ::Nokogiri::XML::Document
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
method :create_engine do
|
31
|
+
|
32
|
+
test "returns an ::RagTag::Engine instance" do
|
33
|
+
e = Malt::Engine::RagTag.new
|
34
|
+
r = e.create_engine(:text=>"<h1>Testing</h1>")
|
35
|
+
r.assert.is_a? ::RagTag
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
testcase Malt::Engine::RDiscount do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "convert RDiscount text" do
|
6
|
+
e = Malt::Engine::RDiscount.new(:text=>"# Testing")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::RDiscount.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"# Testing")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an ::RDiscount instance" do
|
23
|
+
e = Malt::Engine::RDiscount.new
|
24
|
+
r = e.prepare_engine(:text=>"# Testing")
|
25
|
+
r.assert.is_a? ::RDiscount
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
testcase Malt::Engine::RDoc do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "render text" do
|
6
|
+
e = Malt::Engine::RDoc.new(:text=>"= Testing")
|
7
|
+
h = e.render
|
8
|
+
#h.assert.index '<h1 id="label-Testing">Testing</h1>'
|
9
|
+
h.assert.index 'Testing</h1>'
|
10
|
+
end
|
11
|
+
|
12
|
+
test "raises NotImplementedError if converstion format not supported" do
|
13
|
+
e = Malt::Engine::RDoc.new
|
14
|
+
expect NotImplementedError do
|
15
|
+
e.render(:to=>:DNE, :text=>"= Testing")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
method :prepare_engine do
|
22
|
+
|
23
|
+
test "returns an ::RDoc::Markup::ToHtml instance" do
|
24
|
+
e = Malt::Engine::RDoc.new
|
25
|
+
r = e.prepare_engine(:text=>"= Testing")
|
26
|
+
r.assert.is_a? ::RDoc::Markup::ToHtml
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
testcase Malt::Engine::Redcarpet do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "render text" do
|
6
|
+
e = Malt::Engine::Redcarpet.new(:text=>"# Testing")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::Redcarpet.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"# Testing")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an ::Redcarpet instance" do
|
23
|
+
e = Malt::Engine::Redcarpet.new
|
24
|
+
r = e.prepare_engine(:text=>"# Testing")
|
25
|
+
r.assert.is_a? ::Redcarpet
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
testcase Malt::Engine::RedCloth do
|
2
|
+
|
3
|
+
method :render do
|
4
|
+
|
5
|
+
test "render text" do
|
6
|
+
e = Malt::Engine::RedCloth.new(:text=>"h1. Testing")
|
7
|
+
h = e.render
|
8
|
+
h.assert.index "<h1>Testing</h1>"
|
9
|
+
end
|
10
|
+
|
11
|
+
test "raises NotImplementedError if converstion format not supported" do
|
12
|
+
e = Malt::Engine::RedCloth.new
|
13
|
+
expect NotImplementedError do
|
14
|
+
e.render(:to=>:DNE, :text=>"h1. Testing")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
method :prepare_engine do
|
21
|
+
|
22
|
+
test "returns an ::RedCloth instance" do
|
23
|
+
e = Malt::Engine::RedCloth.new
|
24
|
+
r = e.prepare_engine(:text=>"h1. Testing")
|
25
|
+
#RedCloth.assert === r
|
26
|
+
String.assert === r
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|