docgenerator 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/build_test_and_doc.rb +505 -0
- data/examples/creole_example.rb +82 -0
- data/examples/creole_example_footnote.rb +67 -0
- data/examples/creole_example_placeholder.rb +77 -0
- data/examples/creole_example_rail.rb +154 -0
- data/examples/creole_example_rubycode.rb +144 -0
- data/examples/creole_example_struktex.rb +169 -0
- data/examples/docgenerator_example.rb +1 -1
- data/examples/docgenerator_example_footnote.rb +1 -0
- data/examples/docgenerator_example_list.rb +3 -0
- data/examples/docgenerator_example_restrictions.rb +1 -1
- data/examples/docgenerator_example_tabular.rb +1 -1
- data/examples/docgenerator_example_tripfalls.rb +2 -2
- data/examples/results/readme +2 -1
- data/examples/wiki2docgenerator_example.rb +61 -32
- data/lib/creole/creole2doc.rb +57 -58
- data/lib/creole/creole_characters.rb +56 -0
- data/lib/creole/creole_inclusion_and_plugins.rb +59 -284
- data/lib/creole/creole_inclusions.rb +142 -0
- data/lib/creole/creole_placeholder.rb +57 -23
- data/lib/creole/creole_plugins.rb +198 -0
- data/lib/creole/creole_tabular.rb +16 -8
- data/lib/creole/plugins/rail.rb +182 -0
- data/lib/creole/plugins/rubycode4creole.rb +136 -0
- data/lib/creole/plugins/struktex.rb +59 -0
- data/lib/creole/plugins/todonotes.rb +70 -0
- data/lib/docgenerator.rb +161 -71
- data/lib/docgenerator/attribute.rb +189 -156
- data/lib/docgenerator/characters.rb +824 -267
- data/lib/docgenerator/compatibility_v1.rb +249 -0
- data/lib/docgenerator/css.rb +53 -32
- data/lib/docgenerator/document.rb +119 -56
- data/lib/docgenerator/element.rb +304 -351
- data/lib/docgenerator/element_meta.rb +303 -0
- data/lib/docgenerator/elements.rb +1112 -481
- data/lib/docgenerator/environments.rb +153 -62
- data/lib/docgenerator/footnote.rb +30 -9
- data/lib/docgenerator/lists.rb +71 -47
- data/lib/docgenerator/packages/attachfile.rb +136 -0
- data/lib/{packages/docgenerator_caption.rb → docgenerator/packages/caption.rb} +28 -19
- data/lib/docgenerator/packages/hyperref.rb +194 -0
- data/lib/docgenerator/packages/listings.rb +179 -0
- data/lib/docgenerator/packages/pdfpages.rb +43 -0
- data/lib/docgenerator/packages/rubycode4doc.rb +227 -0
- data/lib/{packages/docgenerator_scrlettr2.rb → docgenerator/packages/scrlettr2.rb} +25 -16
- data/lib/docgenerator/packages/scrpage2.rb +410 -0
- data/lib/docgenerator/packages/struktex.rb +447 -0
- data/lib/docgenerator/packages/todonotes.rb +85 -0
- data/lib/{packages/docgenerator_url.rb → docgenerator/packages/url.rb} +7 -6
- data/lib/docgenerator/sections.rb +257 -83
- data/lib/docgenerator/standard.rb +19 -11
- data/lib/docgenerator/tabular.rb +234 -118
- data/lib/{templates → docgenerator/templates}/docgenerator_template.rb +52 -44
- data/lib/{templates → docgenerator/templates}/docgenerator_template.yaml +0 -0
- data/lib/{templates → docgenerator/templates}/docgenerator_template_css.rb +22 -16
- data/lib/wiki2doc/plugins/rubycode4wiki.rb +53 -0
- data/lib/wiki2doc/plugins/struktex.rb +12 -0
- data/lib/wiki2doc/wiki2docgenerator.rb +39 -38
- data/lib/wiki2doc/wikimedia_document.rb +24 -0
- data/manpage_elements.rb +10411 -0
- data/readme.rd +34 -24
- data/unittest/creole_testtext.creole +11 -0
- data/unittest/expected/test_document_usepackage_undefined.log +2 -2
- data/unittest/expected/test_runtex.stdout +0 -1
- data/unittest/expected/test_runtex_2.stdout +0 -1
- data/unittest/expected/toc_css.css +3 -2
- data/unittest/expected_creole/test_creole_characters_all.creole +28 -0
- data/unittest/expected_creole/test_creole_characters_all.html +15 -15
- data/unittest/expected_creole/test_creole_characters_all.latex +15 -15
- data/unittest/expected_creole/test_creole_footnotes_groupid.html +15 -0
- data/unittest/expected_creole/test_creole_links_file.html +2 -2
- data/unittest/expected_creole/test_creole_links_file.latex +2 -2
- data/unittest/expected_creole/test_creole_links_file.text +2 -2
- data/unittest/expected_creole/test_creole_picture_link.html +1 -1
- data/unittest/expected_creole_rail/test_rail_creole_object.tex +33 -0
- data/unittest/expected_creole_rail/test_rail_creole_placeholder.tex +40 -0
- data/unittest/expected_rubycode4doc/creole_complete.html +26 -0
- data/unittest/expected_rubycode4doc/creole_complete.tex +40 -0
- data/unittest/expected_rubycode4doc/creole_in_tab.html +4 -0
- data/unittest/expected_rubycode4doc/creole_in_tab.tex +6 -0
- data/unittest/expected_rubycode4doc/creole_inline_ruby.html +7 -0
- data/unittest/expected_rubycode4doc/creole_output.html +2 -0
- data/unittest/expected_rubycode4doc/creole_output.tex +4 -0
- data/unittest/expected_rubycode4doc/creole_rubycode.html +1 -0
- data/unittest/expected_rubycode4doc/creole_rubycode.tex +3 -0
- data/unittest/expected_rubycode4doc/creole_rubycode_evaluated.html +1 -0
- data/unittest/expected_rubycode4doc/creole_rubycode_evaluated.tex +3 -0
- data/unittest/expected_rubycode4doc/creole_rubycode_evaluated_listings.html +3 -0
- data/unittest/expected_rubycode4doc/creole_rubycode_evaluated_listings.tex +5 -0
- data/unittest/expected_rubycode4doc/wiki_1.html +8 -0
- data/unittest/expected_rubycode4doc/wiki_2.html +8 -0
- data/unittest/expected_rubycode4doc/wiki_3.html +9 -0
- data/unittest/expected_rubycode4doc/wiki_immediate_1.html +5 -0
- data/unittest/expected_rubycode4doc/wiki_immediate_2.html +5 -0
- data/unittest/expected_rubycode4doc/wiki_immediate_3.html +8 -0
- data/unittest/expected_rubycode4doc/wiki_immediate_full.html +21 -0
- data/unittest/expected_struktex/test_struktex_krug.creole +15 -0
- data/unittest/expected_struktex/test_struktex_krug.tex +19 -0
- data/unittest/expected_struktex/test_struktex_krug.wiki +15 -0
- data/unittest/expected_struktex/test_struktex_statement.creole +7 -0
- data/unittest/expected_struktex/test_struktex_statement.tex +9 -0
- data/unittest/expected_struktex/test_struktex_statement.wiki +7 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_description.html +1 -1
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_description.latex +1 -1
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_description.text +1 -1
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_description.wiki +1 -1
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote_2.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_footnote_groupid.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_html_code.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_html_code.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_html_code.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_html_code.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_inline.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_inline.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_inline.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_inline.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_label.html +0 -0
- data/unittest/expected_wikimedia/test_wiki_link.html +8 -0
- data/unittest/expected_wikimedia/test_wiki_link.latex +17 -0
- data/unittest/expected_wikimedia/test_wiki_link.wiki +11 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_after_ul.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_after_ul.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_after_ul.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_after_ul.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_ul.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_ul.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_ul.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ol_ul.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul_too_much.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul_too_much.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul_too_much.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_list_ul_too_much.wiki +0 -0
- data/unittest/expected_wikimedia/test_wiki_picture.html +55 -0
- data/unittest/expected_wikimedia/test_wiki_picture.latex +76 -0
- data/unittest/expected_wikimedia/test_wiki_picture_thumb.html +5 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_tab1.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_tab1.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_tab1.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_textformatting.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_textformatting.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_textformatting.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_textformatting.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_toc.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_toc.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_toc.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_toc.wiki +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_ul_multiple_line.html +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_ul_multiple_line.latex +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_ul_multiple_line.text +0 -0
- data/unittest/{expected_wiki → expected_wikimedia}/test_wiki_ul_multiple_line.wiki +0 -0
- data/unittest/{unittest_creole2doc.rb → unittest_creole.rb} +385 -476
- data/unittest/unittest_creole_placeholders.rb +272 -0
- data/unittest/unittest_creole_plugin_rail.rb +147 -0
- data/unittest/unittest_docgenerator.rb +206 -332
- data/unittest/unittest_docgenerator_characters.rb +650 -0
- data/unittest/unittest_docgenerator_runtex.rb +48 -20
- data/unittest/unittest_packages_struktex.rb +187 -0
- data/unittest/unittest_rubycode4doc.rb +275 -0
- data/unittest/unittest_wikimedia.rb +479 -0
- metadata +245 -172
- data/examples/results_expected/docgenerator_example.html +0 -39
- data/examples/results_expected/docgenerator_example.pdf +0 -0
- data/examples/results_expected/docgenerator_example.tex +0 -56
- data/examples/results_expected/docgenerator_example_footnote.html +0 -40
- data/examples/results_expected/docgenerator_example_footnote.pdf +0 -0
- data/examples/results_expected/docgenerator_example_footnote.tex +0 -50
- data/examples/results_expected/docgenerator_example_list.html +0 -18
- data/examples/results_expected/docgenerator_example_list.pdf +0 -0
- data/examples/results_expected/docgenerator_example_list.tex +0 -46
- data/examples/results_expected/docgenerator_example_restrictions.html +0 -22
- data/examples/results_expected/docgenerator_example_restrictions.pdf +0 -0
- data/examples/results_expected/docgenerator_example_restrictions.tex +0 -31
- data/examples/results_expected/docgenerator_example_tabular.html +0 -37
- data/examples/results_expected/docgenerator_example_tabular.pdf +0 -0
- data/examples/results_expected/docgenerator_example_tabular.tex +0 -41
- data/examples/results_expected/docgenerator_example_tripfalls.html +0 -27
- data/examples/results_expected/docgenerator_example_tripfalls.pdf +0 -0
- data/examples/results_expected/docgenerator_example_tripfalls.tex +0 -31
- data/lib/packages/docgenerator_attachfile.rb +0 -71
- data/lib/packages/docgenerator_hyperref.rb +0 -109
- data/lib/packages/docgenerator_listings.rb +0 -103
- data/lib/packages/docgenerator_pdfpages.rb +0 -24
- data/lib/packages/docgenerator_scrpage2.rb +0 -172
- data/self_docgenerator.rb +0 -163
- data/unittest/expected_wiki/test_wiki_link.html +0 -8
- data/unittest/expected_wiki/test_wiki_link.latex +0 -17
- data/unittest/expected_wiki/test_wiki_link.wiki +0 -11
- data/unittest/expected_wiki/test_wiki_picture.html +0 -55
- data/unittest/expected_wiki/test_wiki_picture.latex +0 -76
- data/unittest/expected_wiki/test_wiki_picture_thumb.html +0 -5
- data/unittest/test_rakefile_docgenerator.rb +0 -43
- data/unittest/unittest_versions.rb +0 -44
- data/unittest/unittest_wiki2doc.rb +0 -464
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,14 +1,15 @@
|
|
1
|
-
# encoding:
|
1
|
+
# encoding: cp1252
|
2
2
|
if $0 == __FILE__
|
3
3
|
$:.unshift("../lib")
|
4
4
|
end
|
5
5
|
|
6
|
+
gem 'test-unit'
|
6
7
|
require 'test/unit'
|
7
8
|
require 'more_unit_test/assert_equal_filecontent.rb'
|
8
9
|
|
9
10
|
require 'creole/creole2doc.rb'
|
10
11
|
|
11
|
-
#~
|
12
|
+
#~ Docgenerator.trace_on
|
12
13
|
|
13
14
|
<<missingtests
|
14
15
|
see Text and
|
@@ -17,17 +18,9 @@ labels
|
|
17
18
|
|
18
19
|
<<ruby>>
|
19
20
|
|
20
|
-
erweitern:
|
21
|
-
*tabulars
|
22
|
-
*Creole_creoletab
|
23
|
-
*csv-tabs
|
24
|
-
|
25
21
|
Creole_document
|
26
22
|
*content mit level..., \tableofcontents...
|
27
23
|
|
28
|
-
placeholder mit parameter (siehe creole_rail)
|
29
|
-
|
30
|
-
|
31
24
|
Bug:
|
32
25
|
http://... am Ende ohne folgenden Text wird falsch erkannt.
|
33
26
|
--> test_creole_links_implicit_end()
|
@@ -37,8 +30,7 @@ missingtests
|
|
37
30
|
#(Running stand alone it's the filename, with require it's './<<filename>>'
|
38
31
|
$thisfile = File.basename(__FILE__)
|
39
32
|
|
40
|
-
|
41
|
-
class Creole
|
33
|
+
class Docgenerator::Creole::Creole
|
42
34
|
#Access to the options.
|
43
35
|
attr_reader :options
|
44
36
|
end
|
@@ -58,9 +50,13 @@ $log.outputters = Log4r::StdoutOutputter.new('log_stdout')
|
|
58
50
|
$tmplog = Log4r::Logger.new('Creole', Log4r::FATAL)
|
59
51
|
|
60
52
|
class Test_creole_basics < Test::Unit::TestCase
|
53
|
+
def setup()
|
54
|
+
#Avoid warnings about missing logger in to_doc
|
55
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
56
|
+
end
|
61
57
|
#Test some basic definitions.
|
62
58
|
def test_creole_initialize()
|
63
|
-
creole = Creole.new(
|
59
|
+
creole = Docgenerator::Creole::Creole.new(
|
64
60
|
:content => 'test'
|
65
61
|
)
|
66
62
|
assert_instance_of( Log4r::Logger, creole.log)
|
@@ -78,44 +74,47 @@ And some more text.
|
|
78
74
|
|
79
75
|
A new paragraph.
|
80
76
|
creole
|
81
|
-
creole = Creole.new(:content => source )
|
77
|
+
creole = Docgenerator::Creole::Creole.new(:content => source )
|
82
78
|
assert_equal( [source], creole.source)
|
83
|
-
|
79
|
+
|
80
|
+
omit_if( RUBY_VERSION == '1.9.2', "Wrong ruby version #{RUBY_VERSION}"){
|
81
|
+
assert_equal_filecontent( "expected_creole/test_creole_input.normsource", creole.normsource.to_yaml)
|
82
|
+
}
|
84
83
|
|
85
|
-
creole = Creole.new(:content => source )
|
86
|
-
creole = Creole.new()
|
84
|
+
creole = Docgenerator::Creole::Creole.new(:content => source )
|
85
|
+
creole = Docgenerator::Creole::Creole.new()
|
87
86
|
creole << source
|
88
87
|
creole << source
|
89
88
|
assert_equal( [source, source], creole.source)
|
90
89
|
end
|
91
90
|
def test_creole_input_array()
|
92
91
|
|
93
|
-
creole = Creole.new(:content => [ "Text1", "Text2" ] )
|
92
|
+
creole = Docgenerator::Creole::Creole.new(:content => [ "Text1", "Text2" ] )
|
94
93
|
assert_equal( ["Text1\nText2"], creole.source)
|
95
94
|
|
96
|
-
creole = Creole.new(:content => [ "Text1\n", "Text2" ] )
|
95
|
+
creole = Docgenerator::Creole::Creole.new(:content => [ "Text1\n", "Text2" ] )
|
97
96
|
assert_equal( ["Text1\nText2"], creole.source)
|
98
97
|
|
99
98
|
#Leading spaces keep staying
|
100
|
-
creole = Creole.new(:content => [ " Text1\n", "Text2" ] )
|
99
|
+
creole = Docgenerator::Creole::Creole.new(:content => [ " Text1\n", "Text2" ] )
|
101
100
|
assert_equal( [" Text1\nText2"], creole.source)
|
102
101
|
|
103
102
|
#Trailing spaces keep staying
|
104
|
-
creole = Creole.new(:content => [ "Text1 \n", "Text2" ] )
|
103
|
+
creole = Docgenerator::Creole::Creole.new(:content => [ "Text1 \n", "Text2" ] )
|
105
104
|
assert_equal( ["Text1 \nText2"], creole.source)
|
106
105
|
|
107
106
|
end #
|
108
107
|
def test_creole_input_undefined()
|
109
|
-
assert_nothing_raised(RuntimeError){ Creole.new(:content => 'source' ) }
|
108
|
+
assert_nothing_raised(RuntimeError){ Docgenerator::Creole::Creole.new(:content => 'source' ) }
|
110
109
|
#~ assert_nothing_raised(RuntimeError){ Creole.new(:content => ['source'] ) }
|
111
|
-
assert_raise(Creole::InputError){ Creole.new(:content => :source ) }
|
110
|
+
assert_raise(Docgenerator::Creole::Creole::InputError){ Docgenerator::Creole::Creole.new(:content => :source ) }
|
112
111
|
end
|
113
112
|
#Check for open File-handles
|
114
113
|
def test_creole_input_file()
|
115
|
-
creole1 = Creole.new( :content => File.read('creole1.0test.txt') )
|
114
|
+
creole1 = Docgenerator::Creole::Creole.new( :content => File.read('creole1.0test.txt') )
|
116
115
|
creole2 = nil
|
117
116
|
File.open('creole1.0test.txt'){|filehandle|
|
118
|
-
creole2 = Creole.new( :content => filehandle )
|
117
|
+
creole2 = Docgenerator::Creole::Creole.new( :content => filehandle )
|
119
118
|
}
|
120
119
|
assert_equal( creole1.source, creole2.source)
|
121
120
|
end
|
@@ -125,47 +124,54 @@ creole
|
|
125
124
|
#ignore this test, if tests are loaded via require.
|
126
125
|
return unless $0 == __FILE__
|
127
126
|
|
128
|
-
creole1 = Creole.new( :name => 'input_file_rb/DATA', :content => DATA )
|
127
|
+
creole1 = Docgenerator::Creole::Creole.new( :name => 'input_file_rb/DATA', :content => DATA )
|
129
128
|
creole2 = nil
|
130
129
|
File.open($thisfile){|filehandle|
|
131
130
|
#~ $log.warn('Test Filehandle auf ruby nicht m�glich (Test $0 == input.path)')
|
132
131
|
#Modify $0 temporary to allow test with condition $0 == input.path
|
133
132
|
$0 = "xxxx#{$thisfile}"
|
134
|
-
creole2 = Creole.new( :name => 'input_file_rb', :content => filehandle, :log => $tmplog )
|
133
|
+
creole2 = Docgenerator::Creole::Creole.new( :name => 'input_file_rb', :content => filehandle, :log => $tmplog )
|
135
134
|
$0 = $thisfile
|
136
135
|
}
|
137
136
|
assert_equal( creole1.source, creole2.source)
|
138
137
|
end
|
139
138
|
def test_creole_input_file_simple
|
140
139
|
assert_true(File.exist?('creole_testtext.creole'))
|
141
|
-
creole = Creole.new()
|
140
|
+
creole = Docgenerator::Creole::Creole.new()
|
142
141
|
File.open('creole_testtext.creole'){|f| creole << f.readlines }
|
143
142
|
end
|
144
143
|
def test_creole_input_file_simple_readlines
|
145
|
-
creole = Creole.new()
|
144
|
+
creole = Docgenerator::Creole::Creole.new()
|
146
145
|
File.open('creole_testtext.creole'){|f| creole << f }
|
147
|
-
assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html))
|
146
|
+
assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html, @opt))
|
148
147
|
end
|
149
148
|
#
|
150
149
|
#This testcases are taken from http://www.wikicreole.org/wiki/Creole1.0TestCases
|
151
150
|
def test_creole_creole1_0test()
|
152
151
|
$log.info('Testcases uncomplete creole1.0test.txt')
|
153
|
-
|
152
|
+
#Logger w/o messages
|
153
|
+
@opt_silent = { :log => Log4r::Logger.new('silent') }
|
154
|
+
creole = Docgenerator::Creole::Creole.new(
|
154
155
|
:name => 'creole_creole1_0test',
|
155
156
|
:content => File.readlines('creole1.0test.txt').join,
|
156
157
|
:log => $tmplog #catch warning for [[links]]
|
157
158
|
)
|
158
|
-
|
159
|
-
assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.
|
159
|
+
|
160
|
+
assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.html", creole.to_doc(:html, @opt_silent))
|
161
|
+
assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.latex", creole.to_doc(:latex, @opt_silent))
|
160
162
|
$log.warn('test_creole_creole1.0test: to_context')
|
161
163
|
#~ assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.context", creole.to_doc(:context))
|
162
164
|
$log.info('test_creole_creole1_0test: uncomplete to_creole')
|
163
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.creole", creole.to_doc(:creole))
|
164
|
-
assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.text", creole.to_doc(:text))
|
165
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.creole", creole.to_doc(:creole, @opt))
|
166
|
+
assert_equal_filecontent( "expected_creole/test_creole_creole1.0test.text", creole.to_doc(:text, @opt_silent))
|
165
167
|
end
|
166
168
|
end #Test_creole_basics
|
167
169
|
|
168
170
|
class Test_creole_paragraphs < Test::Unit::TestCase
|
171
|
+
def setup()
|
172
|
+
#Avoid warnings about missing logger in to_doc
|
173
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
174
|
+
end
|
169
175
|
|
170
176
|
def test_creole_paragraphs()
|
171
177
|
source = <<creole
|
@@ -176,52 +182,54 @@ And some more text.
|
|
176
182
|
And now a new paragraph with some other text.
|
177
183
|
|
178
184
|
creole
|
179
|
-
creole = Creole.new(:content => source )
|
185
|
+
creole = Docgenerator::Creole::Creole.new(:content => source )
|
180
186
|
assert_equal( [source], creole.source)
|
181
187
|
|
182
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.html", creole.to_doc(:html))
|
183
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.latex", creole.to_doc(:latex))
|
188
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.html", creole.to_doc(:html, @opt))
|
189
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.latex", creole.to_doc(:latex, @opt))
|
184
190
|
$log.warn('test_creole_paragraphs: to_context')
|
185
191
|
#~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs.context", creole.to_doc(:context))
|
186
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.wiki", creole.to_doc(:wiki))
|
192
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.wiki", creole.to_doc(:wiki, @opt))
|
187
193
|
$log.info('test_creole_paragraphs: uncomplete to_creole')
|
188
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.text", creole.to_doc(:text))
|
194
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.text", creole.to_doc(:text, @opt))
|
189
195
|
|
190
|
-
|
196
|
+
omit_if( RUBY_VERSION == '1.9.2', "Wrong ruby version #{RUBY_VERSION}"){
|
197
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs.normsource", creole.normsource.to_yaml)
|
198
|
+
}
|
191
199
|
end
|
192
200
|
def test_creole_paragraphs_wrap()
|
193
|
-
creole = Creole.new(:content => <<creole
|
201
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
194
202
|
And now a line which is a bit longer then 80 characters in the input line. Creole should split it at position 75 or a bit later (depending on the word length at position 75).
|
195
203
|
creole
|
196
204
|
)
|
197
205
|
|
198
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.html", creole.to_doc(:html))
|
199
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.latex", creole.to_doc(:latex))
|
206
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.html", creole.to_doc(:html, @opt))
|
207
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.latex", creole.to_doc(:latex, @opt))
|
200
208
|
$log.warn('test_creole_paragraphs_wrap: to_context')
|
201
209
|
#~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.context", creole.to_doc(:context))
|
202
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.wiki", creole.to_doc(:wiki))
|
210
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.wiki", creole.to_doc(:wiki, @opt))
|
203
211
|
$log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
|
204
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.text", creole.to_doc(:text))
|
212
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap.text", creole.to_doc(:text, @opt))
|
205
213
|
end #test_creole_paragraphs_wrap()
|
206
214
|
def test_creole_paragraphs_wrap60()
|
207
215
|
|
208
|
-
creole = Creole.new(:wrap_at => 60, :content => <<creole
|
216
|
+
creole = Docgenerator::Creole::Creole.new(:wrap_at => 60, :content => <<creole
|
209
217
|
And now a line which is a bit longer then 80 characters in the input line. Creole should split it at position 60 or a bit later (depending on the word length at position 60).
|
210
218
|
creole
|
211
219
|
)
|
212
220
|
|
213
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.html", creole.to_doc(:html))
|
214
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.latex", creole.to_doc(:latex))
|
221
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.html", creole.to_doc(:html, @opt))
|
222
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.latex", creole.to_doc(:latex, @opt))
|
215
223
|
$log.warn('test_creole_paragraphs_wrap60: to_context')
|
216
224
|
#~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.context", creole.to_doc(:context))
|
217
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.wiki", creole.to_doc(:wiki))
|
225
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.wiki", creole.to_doc(:wiki, @opt))
|
218
226
|
$log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
|
219
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.text", creole.to_doc(:text))
|
227
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap60.text", creole.to_doc(:text, @opt))
|
220
228
|
end #test_creole_paragraphs_wrap60()
|
221
229
|
|
222
230
|
def test_creole_paragraphs_wrap0()
|
223
231
|
|
224
|
-
creole = Creole.new(:wrap_at => 0, :content => <<creole
|
232
|
+
creole = Docgenerator::Creole::Creole.new(:wrap_at => 0, :content => <<creole
|
225
233
|
And now a line which is a bit longer then 80 characters in the input line. Creole should not split it, because we defined split_at to 0.
|
226
234
|
|
227
235
|
And now a line which is a bit longer then 80 characters in the input line.
|
@@ -229,20 +237,24 @@ Creole should not split it, because we defined split_at to 0.
|
|
229
237
|
creole
|
230
238
|
)
|
231
239
|
|
232
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.html", creole.to_doc(:html))
|
233
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.latex", creole.to_doc(:latex))
|
240
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.html", creole.to_doc(:html, @opt))
|
241
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.latex", creole.to_doc(:latex, @opt))
|
234
242
|
$log.warn('test_creole_paragraphs_wrap0: to_context')
|
235
243
|
#~ assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.context", creole.to_doc(:context))
|
236
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.wiki", creole.to_doc(:wiki))
|
244
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.wiki", creole.to_doc(:wiki, @opt))
|
237
245
|
$log.info('test_creole_paragraphs_wrap: uncomplete to_creole')
|
238
|
-
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.text", creole.to_doc(:text))
|
246
|
+
assert_equal_filecontent( "expected_creole/test_creole_paragraphs_wrap0.text", creole.to_doc(:text, @opt))
|
239
247
|
end
|
240
248
|
end #Test_creole_paragraphs < Test::Unit::TestCase
|
241
249
|
|
242
250
|
class Test_creole_headings < Test::Unit::TestCase
|
243
|
-
|
251
|
+
def setup()
|
252
|
+
#Avoid warnings about missing logger in to_doc
|
253
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
254
|
+
end
|
255
|
+
|
244
256
|
def test_creole_headings()
|
245
|
-
creole = Creole.new(:content => <<creole
|
257
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
246
258
|
= Top-level heading (1)
|
247
259
|
== This a test for creole 0.1 (2)
|
248
260
|
=== This is a Subheading (3)
|
@@ -263,20 +275,20 @@ The content is not parsed.
|
|
263
275
|
creole
|
264
276
|
)
|
265
277
|
|
266
|
-
assert_equal_filecontent( "expected_creole/test_creole_headings.html", creole.to_doc(:html))
|
267
|
-
assert_equal_filecontent( "expected_creole/test_creole_headings.latex", creole.to_doc(:latex))
|
278
|
+
assert_equal_filecontent( "expected_creole/test_creole_headings.html", creole.to_doc(:html, @opt))
|
279
|
+
assert_equal_filecontent( "expected_creole/test_creole_headings.latex", creole.to_doc(:latex, @opt))
|
268
280
|
$log.warn('test_creole_headings: to_context')
|
269
281
|
#~ assert_equal_filecontent( "expected_creole/test_creole_headings.context", creole.to_doc(:context))
|
270
|
-
assert_equal_filecontent( "expected_creole/test_creole_headings.wiki", creole.to_doc(:wiki))
|
282
|
+
assert_equal_filecontent( "expected_creole/test_creole_headings.wiki", creole.to_doc(:wiki, @opt))
|
271
283
|
$log.info('test_creole_paragraphs: uncomplete to_creole')
|
272
|
-
assert_equal_filecontent( "expected_creole/test_creole_headings.text", creole.to_doc(:text))
|
284
|
+
assert_equal_filecontent( "expected_creole/test_creole_headings.text", creole.to_doc(:text, @opt))
|
273
285
|
end #test_creole_headings
|
274
286
|
#
|
275
287
|
#Modification of standard: Labels for headings.
|
276
288
|
#
|
277
289
|
#Including the definition of a label tor the toc.
|
278
290
|
def test_creole_label()
|
279
|
-
creole = Creole.new(:content => <<creole
|
291
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
280
292
|
==Titel 1==
|
281
293
|
Text
|
282
294
|
===Titel 2===
|
@@ -286,20 +298,24 @@ Text unter Titel 2b.
|
|
286
298
|
creole
|
287
299
|
)
|
288
300
|
#Check the manual label
|
289
|
-
assert_equal_filecontent( "expected_creole/test_creole_label.html", creole.to_doc(:html))
|
290
|
-
assert_equal_filecontent( "expected_creole/test_creole_label.latex", creole.to_doc(:latex))
|
301
|
+
assert_equal_filecontent( "expected_creole/test_creole_label.html", creole.to_doc(:html, @opt))
|
302
|
+
assert_equal_filecontent( "expected_creole/test_creole_label.latex", creole.to_doc(:latex, @opt))
|
291
303
|
$log.warn('test_creole_label: to_context')
|
292
304
|
#~ assert_equal_filecontent( "expected_creole/test_creole_label.context", creole.to_doc(:context))
|
293
305
|
$log.info('test_creole_label: uncomplete text/to_creole')
|
294
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_label.creole", creole.to_doc(:creole))
|
295
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_label.text", creole.to_doc(:text))
|
306
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_label.creole", creole.to_doc(:creole, @opt))
|
307
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_label.text", creole.to_doc(:text, @opt))
|
296
308
|
|
297
309
|
end
|
298
310
|
end #Test_creole_headings < Test::Unit::TestCase
|
299
311
|
|
300
312
|
class Test_creole_toc < Test::Unit::TestCase
|
313
|
+
def setup()
|
314
|
+
#Avoid warnings about missing logger in to_doc
|
315
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
316
|
+
end
|
301
317
|
def test_creole_toc()
|
302
|
-
creole = Creole.new(
|
318
|
+
creole = Docgenerator::Creole::Creole.new(
|
303
319
|
:name => 'toc',
|
304
320
|
:content => <<creole
|
305
321
|
=one
|
@@ -309,20 +325,20 @@ class Test_creole_toc < Test::Unit::TestCase
|
|
309
325
|
==three-one
|
310
326
|
creole
|
311
327
|
)
|
312
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc.html", creole.toc.to_doc(:html))
|
313
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc_text.html", creole.to_doc(:html))
|
314
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc.latex", creole.toc.to_doc(:latex))
|
315
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc_text.latex", creole.to_doc(:latex))
|
328
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc.html", creole.toc.to_doc(:html, @opt))
|
329
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc_text.html", creole.to_doc(:html, @opt))
|
330
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc.latex", creole.toc.to_doc(:latex, @opt))
|
331
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc_text.latex", creole.to_doc(:latex, @opt))
|
316
332
|
$log.warn('test_creole_toc_text: to_context')
|
317
333
|
#~ assert_equal_filecontent( "expected_creole/test_creole_toc_text.context", creole.to_doc(:context))
|
318
334
|
$log.warn('test_creole_toc: to wiki/creole')
|
319
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_toc.creole", creole.to_doc(:creole))
|
320
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc.text", creole.toc.to_doc(:text))
|
335
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_toc.creole", creole.to_doc(:creole, @opt))
|
336
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc.text", creole.toc.to_doc(:text, @opt))
|
321
337
|
end #test_creole_toc
|
322
338
|
#Build the toc, but only up to level toclevel.
|
323
339
|
def test_creole_toc_level()
|
324
340
|
toclevel = 1
|
325
|
-
creole = Creole.new(
|
341
|
+
creole = Docgenerator::Creole::Creole.new(
|
326
342
|
:name => 'toc',
|
327
343
|
:content => <<creole
|
328
344
|
Test for document with toc-level #{toclevel}
|
@@ -333,21 +349,25 @@ Test for document with toc-level #{toclevel}
|
|
333
349
|
==three-one
|
334
350
|
creole
|
335
351
|
)
|
336
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc_level.html", creole.toc(:level => toclevel).to_doc(:html))
|
337
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc_level_text.html", creole.to_doc(:html))
|
338
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc_level.latex", creole.toc(:level => toclevel).to_doc(:latex))
|
352
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc_level.html", creole.toc(:level => toclevel).to_doc(:html, @opt))
|
353
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc_level_text.html", creole.to_doc(:html, @opt))
|
354
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc_level.latex", creole.toc(:level => toclevel).to_doc(:latex, @opt))
|
339
355
|
assert_equal_filecontent( "expected_creole/test_creole_toc_level_text.latex", creole.to_doc(:latex, :level => toclevel))
|
340
356
|
$log.warn('test_creole_toc_text: to_context')
|
341
357
|
#~ assert_equal_filecontent( "expected_creole/test_creole_toc_text.context", creole.to_doc(:context)
|
342
358
|
$log.warn('test_creole_toc: to wiki/creole')
|
343
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_toc_level.creole", creole.to_doc(:creole)
|
344
|
-
assert_equal_filecontent( "expected_creole/test_creole_toc_level.text", creole.toc(:level => toclevel).to_doc(:text))
|
359
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_toc_level.creole", creole.to_doc(:creole, @opt)
|
360
|
+
assert_equal_filecontent( "expected_creole/test_creole_toc_level.text", creole.toc(:level => toclevel).to_doc(:text, @opt))
|
345
361
|
end #test_creole_toc_level
|
346
362
|
end #Test_creole_toc
|
347
363
|
|
348
364
|
class Test_creole_paragraph2 < Test::Unit::TestCase
|
365
|
+
def setup()
|
366
|
+
#Avoid warnings about missing logger in to_doc
|
367
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
368
|
+
end
|
349
369
|
def test_creole_newline()
|
350
|
-
creole = Creole.new(
|
370
|
+
creole = Docgenerator::Creole::Creole.new(
|
351
371
|
:name => 'newline',
|
352
372
|
:content => <<'creole'
|
353
373
|
You can format an address by simply forcing linebreaks:
|
@@ -359,16 +379,16 @@ Mobile: abc
|
|
359
379
|
|
360
380
|
creole
|
361
381
|
)
|
362
|
-
assert_equal_filecontent( "expected_creole/test_creole_newline.html", creole.to_doc(:html))
|
363
|
-
assert_equal_filecontent( "expected_creole/test_creole_newline.latex", creole.to_doc(:latex))
|
382
|
+
assert_equal_filecontent( "expected_creole/test_creole_newline.html", creole.to_doc(:html, @opt))
|
383
|
+
assert_equal_filecontent( "expected_creole/test_creole_newline.latex", creole.to_doc(:latex, @opt))
|
364
384
|
$log.warn('test_creole_newline: to_context')
|
365
385
|
#~ assert_equal_filecontent( "expected_creole/test_creole_newline.context", creole.to_doc(:context))
|
366
386
|
$log.warn('test_creole_newline: to wiki/creole')
|
367
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_newline.creole", creole.to_doc(:creole))
|
368
|
-
assert_equal_filecontent( "expected_creole/test_creole_newline.text", creole.to_doc(:text))
|
387
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_newline.creole", creole.to_doc(:creole, @opt))
|
388
|
+
assert_equal_filecontent( "expected_creole/test_creole_newline.text", creole.to_doc(:text, @opt))
|
369
389
|
end #test_creole_newline
|
370
390
|
def test_creole_hr()
|
371
|
-
creole = Creole.new(
|
391
|
+
creole = Docgenerator::Creole::Creole.new(
|
372
392
|
:name => 'hr',
|
373
393
|
:content => <<creole
|
374
394
|
|
@@ -377,58 +397,66 @@ You can use this to draw a line to separate the page:
|
|
377
397
|
This is after the horizontal line
|
378
398
|
creole
|
379
399
|
)
|
380
|
-
assert_equal_filecontent( "expected_creole/test_creole_hr.html", creole.to_doc(:html))
|
381
|
-
assert_equal_filecontent( "expected_creole/test_creole_hr.latex", creole.to_doc(:latex))
|
400
|
+
assert_equal_filecontent( "expected_creole/test_creole_hr.html", creole.to_doc(:html, @opt))
|
401
|
+
assert_equal_filecontent( "expected_creole/test_creole_hr.latex", creole.to_doc(:latex, @opt))
|
382
402
|
$log.warn('test_creole_hr: to_context')
|
383
403
|
#~ assert_equal_filecontent( "expected_creole/test_creole_hr.context", creole.to_doc(:context))
|
384
404
|
$log.warn('test_creole_hr: to wiki/creole')
|
385
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_hr.creole", creole.to_doc(:creole))
|
386
|
-
assert_equal_filecontent( "expected_creole/test_creole_hr.text", creole.to_doc(:text))
|
405
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_hr.creole", creole.to_doc(:creole, @opt))
|
406
|
+
assert_equal_filecontent( "expected_creole/test_creole_hr.text", creole.to_doc(:text, @opt))
|
387
407
|
end #test_creole_hr
|
388
408
|
|
389
409
|
end #Test_creole_paragraph2
|
390
410
|
|
391
411
|
|
392
412
|
class Test_creole_inline < Test::Unit::TestCase
|
413
|
+
def setup()
|
414
|
+
#Avoid warnings about missing logger in to_doc
|
415
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
416
|
+
end
|
393
417
|
|
394
418
|
def test_creole_inline_bold_em()
|
395
|
-
creole = Creole.new(:content => <<creole
|
419
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
396
420
|
You can make things **bold** or //italic// or **//both//** or //**both**//.
|
397
421
|
creole
|
398
422
|
)
|
399
|
-
assert_equal_filecontent( "expected_creole/test_creole_inline.html", creole.to_doc(:html))
|
400
|
-
assert_equal_filecontent( "expected_creole/test_creole_inline.latex", creole.to_doc(:latex))
|
423
|
+
assert_equal_filecontent( "expected_creole/test_creole_inline.html", creole.to_doc(:html, @opt))
|
424
|
+
assert_equal_filecontent( "expected_creole/test_creole_inline.latex", creole.to_doc(:latex, @opt))
|
401
425
|
$log.warn('test_creole_inline: to_context')
|
402
426
|
#~ assert_equal_filecontent( "expected_creole/test_creole_inline.context", creole.to_doc(:context))
|
403
427
|
$log.info('test_creole_inline_bold_em: inline to wiki/creole')
|
404
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_inline.creole", creole.to_doc(:creole))
|
428
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_inline.creole", creole.to_doc(:creole, @opt))
|
405
429
|
$log.warn('test_creole_inline_bold_em: inline text with additional spaces')
|
406
|
-
assert_equal_filecontent( "expected_creole/test_creole_inline.text", creole.to_doc(:text))
|
430
|
+
assert_equal_filecontent( "expected_creole/test_creole_inline.text", creole.to_doc(:text, @opt))
|
407
431
|
end
|
408
432
|
|
409
433
|
def test_creole_inline_bold_line_break()
|
410
|
-
creole = Creole.new(:content => <<creole
|
434
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
411
435
|
Character formatting extends across line breaks: **bold,
|
412
436
|
this is still bold. This line deliberately does not end in star-star.
|
413
437
|
|
414
438
|
Not bold. Character formatting does not cross paragraph boundaries.
|
415
439
|
creole
|
416
440
|
)
|
417
|
-
assert_equal_filecontent( "expected_creole/test_creole_line_break.html", creole.to_doc(:html))
|
418
|
-
assert_equal_filecontent( "expected_creole/test_creole_line_break.latex", creole.to_doc(:latex))
|
441
|
+
assert_equal_filecontent( "expected_creole/test_creole_line_break.html", creole.to_doc(:html, @opt))
|
442
|
+
assert_equal_filecontent( "expected_creole/test_creole_line_break.latex", creole.to_doc(:latex, @opt))
|
419
443
|
$log.warn('test_creole_line_break: to_context')
|
420
444
|
#~ assert_equal_filecontent( "expected_creole/test_creole_line_break.context", creole.to_doc(:context))
|
421
445
|
$log.info('test_creole_inline_bold_line_break: inline to wiki/creole')
|
422
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_line_break.creole", creole.to_doc(:creole))
|
423
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_line_break.text", creole.to_doc(:text))
|
446
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_line_break.creole", creole.to_doc(:creole, @opt))
|
447
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_line_break.text", creole.to_doc(:text, @opt))
|
424
448
|
end
|
425
449
|
|
426
450
|
end #Test_creole_inline
|
427
451
|
|
428
452
|
|
429
453
|
class Test_creole_lists < Test::Unit::TestCase
|
454
|
+
def setup()
|
455
|
+
#Avoid warnings about missing logger in to_doc
|
456
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
457
|
+
end
|
430
458
|
def test_creole_list_ul()
|
431
|
-
creole = Creole.new(:content => <<creole
|
459
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
432
460
|
Text before
|
433
461
|
*Listentry 1
|
434
462
|
*Listentry 2
|
@@ -446,19 +474,21 @@ list item
|
|
446
474
|
Text afterwords
|
447
475
|
creole
|
448
476
|
)
|
449
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ul.html", creole.to_doc(:html))
|
450
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ul.latex", creole.to_doc(:latex))
|
477
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ul.html", creole.to_doc(:html, @opt))
|
478
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ul.latex", creole.to_doc(:latex, @opt))
|
451
479
|
$log.warn('test_creole_list_ul: to_context')
|
452
480
|
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.context", creole.to_doc(:context))
|
453
481
|
$log.warn('test_creole_list_ul: list to wiki/creole')
|
454
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.creole", creole.to_doc(:creole))
|
455
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.wiki", creole.to_doc(:wiki))
|
456
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.text", creole.to_doc(:text))
|
457
|
-
|
482
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.creole", creole.to_doc(:creole, @opt))
|
483
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.wiki", creole.to_doc(:wiki, @opt))
|
484
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul.text", creole.to_doc(:text, @opt))
|
485
|
+
omit_if( RUBY_VERSION == '1.9.2', "Wrong ruby version #{RUBY_VERSION}"){
|
486
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ul.normsource", creole.normsource.to_yaml)
|
487
|
+
}
|
458
488
|
end
|
459
489
|
#It works fine here, but LaTeX will give you an error.
|
460
490
|
def test_creole_list_ul_too_much()
|
461
|
-
creole = Creole.new(:content => <<creole
|
491
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
462
492
|
Text before
|
463
493
|
*Listentry 1
|
464
494
|
*Listentry 2
|
@@ -472,16 +502,16 @@ Text before
|
|
472
502
|
Text afterwords
|
473
503
|
creole
|
474
504
|
)
|
475
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.html", creole.to_doc(:html))
|
476
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.latex", creole.to_doc(:latex))
|
505
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.html", creole.to_doc(:html, @opt))
|
506
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.latex", creole.to_doc(:latex, @opt))
|
477
507
|
$log.warn('test_creole_list_ul_too_much: to_context')
|
478
508
|
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.context", creole.to_doc(:context))
|
479
509
|
$log.warn('test_creole_list_ul_too_much: list to wiki/creole')
|
480
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.creole", creole.to_doc(:creole))
|
481
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.text", creole.to_doc(:text))
|
510
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.creole", creole.to_doc(:creole, @opt))
|
511
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ul_too_much.text", creole.to_doc(:text, @opt))
|
482
512
|
end
|
483
513
|
def test_creole_list_ol()
|
484
|
-
creole = Creole.new(:content => <<creole
|
514
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
485
515
|
Text before
|
486
516
|
#Listentry 1
|
487
517
|
#Listentry 2
|
@@ -491,17 +521,17 @@ Text before
|
|
491
521
|
Text afterwords
|
492
522
|
creole
|
493
523
|
)
|
494
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ol.html", creole.to_doc(:html))
|
495
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ol.latex", creole.to_doc(:latex))
|
524
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ol.html", creole.to_doc(:html, @opt))
|
525
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ol.latex", creole.to_doc(:latex, @opt))
|
496
526
|
$log.warn('test_creole_list_ol: to_context')
|
497
527
|
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.context", creole.to_doc(:context))
|
498
528
|
$log.warn('test_creole_list_ol: list to wiki/creole')
|
499
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.creole", creole.to_doc(:creole))
|
500
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.text", creole.to_doc(:text))
|
529
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.creole", creole.to_doc(:creole, @opt))
|
530
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol.text", creole.to_doc(:text, @opt))
|
501
531
|
end #ol
|
502
532
|
|
503
533
|
def test_creole_list_ol_ul()
|
504
|
-
creole = Creole.new(:content => <<creole
|
534
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
505
535
|
Text before
|
506
536
|
#Listentry 1
|
507
537
|
#Listentry 2
|
@@ -512,17 +542,17 @@ Text before
|
|
512
542
|
Text afterwords
|
513
543
|
creole
|
514
544
|
)
|
515
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.html", creole.to_doc(:html))
|
516
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.latex", creole.to_doc(:latex))
|
545
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.html", creole.to_doc(:html, @opt))
|
546
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.latex", creole.to_doc(:latex, @opt))
|
517
547
|
$log.warn('test_creole_list_ol_ul: to_context')
|
518
548
|
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.context", creole.to_doc(:context))
|
519
549
|
$log.warn('test_creole_list_ol_ul: list to wiki/creole')
|
520
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.creole", creole.to_doc(:creole))
|
521
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.text", creole.to_doc(:text))
|
550
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.creole", creole.to_doc(:creole, @opt))
|
551
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_ul.text", creole.to_doc(:text, @opt))
|
522
552
|
end
|
523
553
|
|
524
554
|
def test_creole_list_ol_after_ul()
|
525
|
-
creole = Creole.new(:content => <<creole
|
555
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
526
556
|
Text before
|
527
557
|
*Listentry 1
|
528
558
|
#Listentry 2
|
@@ -530,19 +560,19 @@ Text before
|
|
530
560
|
Text afterwords
|
531
561
|
creole
|
532
562
|
)
|
533
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.html", creole.to_doc(:html))
|
534
|
-
assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.latex", creole.to_doc(:latex))
|
563
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.html", creole.to_doc(:html, @opt))
|
564
|
+
assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.latex", creole.to_doc(:latex, @opt))
|
535
565
|
$log.warn('test_creole_list_ol_after_ul: to_context')
|
536
566
|
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.context", creole.to_doc(:context))
|
537
567
|
$log.warn('test_creole_list_ol_after_ul: list to wiki/creole')
|
538
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.creole", creole.to_doc(:creole))
|
539
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.text", creole.to_doc(:text))
|
568
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.creole", creole.to_doc(:creole, @opt))
|
569
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_list_ol_after_ul.text", creole.to_doc(:text, @opt))
|
540
570
|
end
|
541
571
|
|
542
572
|
#Line breaks will be lost.
|
543
573
|
def test_creole_ul_multiple_line()
|
544
574
|
$log.warn('test_creole_ul_multiple_line: latex: grosse textl�cken (wrap mit leerzeichen bereinigen?)')
|
545
|
-
creole = Creole.new(:content => <<creole
|
575
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
546
576
|
* vorher
|
547
577
|
* text
|
548
578
|
mehr text zum item
|
@@ -552,16 +582,16 @@ creole
|
|
552
582
|
* nachher
|
553
583
|
creole
|
554
584
|
)
|
555
|
-
assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.html", creole.to_doc(:html))
|
556
|
-
assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.latex", creole.to_doc(:latex))
|
585
|
+
assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.html", creole.to_doc(:html, @opt))
|
586
|
+
assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.latex", creole.to_doc(:latex, @opt))
|
557
587
|
$log.warn('test_creole_ul_multiple_line: to_context')
|
558
588
|
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.context", creole.to_doc(:context))
|
559
589
|
$log.warn('test_creole_ul_multiple_line: list to wiki/creole')
|
560
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.creole", creole.to_doc(:creole))
|
561
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.text", creole.to_doc(:text)) #fixme
|
590
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.creole", creole.to_doc(:creole, @opt))
|
591
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_multiple_line.text", creole.to_doc(:text, @opt)) #fixme
|
562
592
|
end
|
563
593
|
def test_creole_ul_with_bold()
|
564
|
-
creole = Creole.new(:content => <<creole
|
594
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
565
595
|
You can use lists, start it at the first column for now, please...
|
566
596
|
|
567
597
|
unnumbered lists are like
|
@@ -571,16 +601,16 @@ unnumbered lists are like
|
|
571
601
|
Text
|
572
602
|
creole
|
573
603
|
)
|
574
|
-
assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.html", creole.to_doc(:html))
|
575
|
-
assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.latex", creole.to_doc(:latex))
|
604
|
+
assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.html", creole.to_doc(:html, @opt))
|
605
|
+
assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.latex", creole.to_doc(:latex, @opt))
|
576
606
|
$log.warn('test_creole_ul_with_bold: to_context')
|
577
607
|
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.context", creole.to_doc(:context))
|
578
608
|
$log.warn('test_creole_ul_with_bold: list to wiki/creole')
|
579
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.creole", creole.to_doc(:creole))
|
580
|
-
assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.text", creole.to_doc(:text))
|
609
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.creole", creole.to_doc(:creole, @opt))
|
610
|
+
assert_equal_filecontent( "expected_creole/test_creole_ul_with_bold.text", creole.to_doc(:text, @opt))
|
581
611
|
end
|
582
612
|
def test_creole_ul_with_blank()
|
583
|
-
creole = Creole.new(:content => <<creole
|
613
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
584
614
|
blank space is also permitted before lists like:
|
585
615
|
* item a
|
586
616
|
* item b
|
@@ -589,17 +619,17 @@ blank space is also permitted before lists like:
|
|
589
619
|
Text
|
590
620
|
creole
|
591
621
|
)
|
592
|
-
assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.html", creole.to_doc(:html))
|
593
|
-
assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.latex", creole.to_doc(:latex))
|
622
|
+
assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.html", creole.to_doc(:html, @opt))
|
623
|
+
assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.latex", creole.to_doc(:latex, @opt))
|
594
624
|
$log.warn('test_creole_ul_with_blank: to_context')
|
595
625
|
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.context", creole.to_doc(:context))
|
596
626
|
$log.warn('test_creole_ul_with_blank: list to wiki/creole')
|
597
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.creole", creole.to_doc(:creole))
|
598
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.text", creole.to_doc(:text))
|
627
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.creole", creole.to_doc(:creole, @opt))
|
628
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_ul_with_blank.text", creole.to_doc(:text, @opt))
|
599
629
|
end
|
600
630
|
#Check, if the second list is really a second list.
|
601
631
|
def test_creole_mix_titles_list()
|
602
|
-
creole = Creole.new(
|
632
|
+
creole = Docgenerator::Creole::Creole.new(
|
603
633
|
:name => 'mix_titles_list',
|
604
634
|
:content => <<creole
|
605
635
|
=Titel 1
|
@@ -610,13 +640,13 @@ creole
|
|
610
640
|
*item 2
|
611
641
|
creole
|
612
642
|
)
|
613
|
-
assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.html", creole.to_doc(:html))
|
614
|
-
assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.latex", creole.to_doc(:latex))
|
643
|
+
assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.html", creole.to_doc(:html, @opt))
|
644
|
+
assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.latex", creole.to_doc(:latex, @opt))
|
615
645
|
$log.warn('test_creole_mix_titles_list: to_context')
|
616
646
|
#~ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.context", creole.to_doc(:context))
|
617
647
|
$log.warn('test_creole_mix_titles_list: to wiki/creole')
|
618
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.creole", creole.to_doc(:creole))
|
619
|
-
assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.text", creole.to_doc(:text))
|
648
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.creole", creole.to_doc(:creole, @opt))
|
649
|
+
assert_equal_filecontent( "expected_creole/test_creole_mix_titles_list.text", creole.to_doc(:text, @opt))
|
620
650
|
end #test_creole_mix_titles_list
|
621
651
|
|
622
652
|
end #Test_creole_List
|
@@ -624,24 +654,28 @@ end #Test_creole_List
|
|
624
654
|
|
625
655
|
|
626
656
|
class Test_creole_links < Test::Unit::TestCase
|
657
|
+
def setup()
|
658
|
+
#Avoid warnings about missing logger in to_doc
|
659
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
660
|
+
end
|
627
661
|
def test_creole_links_external_explizit()
|
628
|
-
creole = Creole.new(:content => <<creole
|
662
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
629
663
|
Here's a external link without a description: [[http://www.wikicreole.org]].
|
630
664
|
|
631
665
|
And here's a external link with a description: [[http://www.wikicreole.org|wikicreole.org]].
|
632
666
|
creole
|
633
667
|
)
|
634
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_external.html", creole.to_doc(:html))
|
635
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_external.latex", creole.to_doc(:latex))
|
668
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_external.html", creole.to_doc(:html, @opt))
|
669
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_external.latex", creole.to_doc(:latex, @opt))
|
636
670
|
$log.warn('test_creole_links_external: to_context')
|
637
671
|
#~ assert_equal_filecontent( "expected_creole/test_creole_links_external.context", creole.to_doc(:context))
|
638
672
|
$log.warn('test_creole_links_external: to wiki/creole')
|
639
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_links_external.creole", creole.to_doc(:creole))
|
640
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_external.text", creole.to_doc(:text))
|
673
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_links_external.creole", creole.to_doc(:creole, @opt))
|
674
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_external.text", creole.to_doc(:text, @opt))
|
641
675
|
end #test_creole_links_external
|
642
676
|
|
643
677
|
def test_creole_links_external_implicit()
|
644
|
-
creole = Creole.new(:content => <<creole
|
678
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
645
679
|
Free links without braces should be rendered as well, like http://www.wikicreole.org/ and [[http://www.wikicreole.org/users/~example]].
|
646
680
|
|
647
681
|
See also description: http://www.wikicreole.org/wiki/Links
|
@@ -650,13 +684,13 @@ In case of phrase ends with . you should use explicit links like
|
|
650
684
|
[[http://www.wikicreole.org/users/~example]].
|
651
685
|
creole
|
652
686
|
)
|
653
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.html", creole.to_doc(:html))
|
654
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.latex", creole.to_doc(:latex))
|
687
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.html", creole.to_doc(:html, @opt))
|
688
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.latex", creole.to_doc(:latex, @opt))
|
655
689
|
$log.warn('test_creole_links_external_implicit: to_context')
|
656
690
|
#~ assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.context", creole.to_doc(:context))
|
657
691
|
$log.warn('test_creole_links_external_implicit: to wiki/creole')
|
658
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.creole", creole.to_doc(:creole))
|
659
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.text", creole.to_doc(:text))
|
692
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.creole", creole.to_doc(:creole, @opt))
|
693
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_external_implicit.text", creole.to_doc(:text, @opt))
|
660
694
|
end #test_creole_links_external_implicit
|
661
695
|
|
662
696
|
#
|
@@ -664,73 +698,77 @@ creole
|
|
664
698
|
# <a href = "http:" >http:</a> <em >www.wikicreole.org/users/~example</em>
|
665
699
|
#If the very end of a text is a link, it is not detected correct
|
666
700
|
def test_creole_links_implicit_end()
|
667
|
-
creole = Creole.new(
|
701
|
+
creole = Docgenerator::Creole::Creole.new(
|
668
702
|
:name => 'links_implicit_end',
|
669
703
|
:content => "http://www.wikicreole.org/users/~example"
|
670
704
|
)
|
671
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.html", creole.to_doc(:html))
|
672
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.latex", creole.to_doc(:latex))
|
705
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.html", creole.to_doc(:html, @opt))
|
706
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.latex", creole.to_doc(:latex, @opt))
|
673
707
|
#~ $log.warn('test_creole_links_implicit_end: to_context')
|
674
708
|
#~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.context", creole.to_doc(:context))
|
675
709
|
#~ $log.warn('test_creole_links_implicit_end: to wiki/creole')
|
676
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.creole", creole.to_doc(:creole))
|
677
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.text", creole.to_doc(:text))
|
710
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.creole", creole.to_doc(:creole, @opt))
|
711
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_links_implicit_end.text", creole.to_doc(:text, @opt))
|
678
712
|
end #test_creole_links_implicit_end
|
679
713
|
|
680
714
|
def test_creole_links_explicit_with_em()
|
681
|
-
creole = Creole.new(:content => <<creole
|
715
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
682
716
|
Be careful that italic links are rendered properly: //[[http://my.book.example/|My Book Title]]//
|
683
717
|
creole
|
684
718
|
)
|
685
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.html", creole.to_doc(:html))
|
686
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.latex", creole.to_doc(:latex))
|
719
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.html", creole.to_doc(:html, @opt))
|
720
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.latex", creole.to_doc(:latex, @opt))
|
687
721
|
$log.warn('test_creole_links_explicit_with_em: to_context')
|
688
722
|
#~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.context", creole.to_doc(:context))
|
689
723
|
$log.warn('test_creole_links_explicit_with_em: to wiki/creole')
|
690
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.creole", creole.to_doc(:creole))
|
691
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.text", creole.to_doc(:text))
|
724
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.creole", creole.to_doc(:creole, @opt))
|
725
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_with_em.text", creole.to_doc(:text, @opt))
|
692
726
|
end #test_creole_links_explicit_with_em
|
693
727
|
|
694
728
|
def test_creole_links_file()
|
695
729
|
|
696
|
-
creole = Creole.new(:content => <<creole
|
730
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
697
731
|
[[./#{$thisfile}]]
|
698
732
|
|
699
733
|
[[./#{$thisfile}|This unittest-source]]
|
700
734
|
creole
|
701
735
|
)
|
702
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_file.html", creole.to_doc(:html))
|
703
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_file.latex", creole.to_doc(:latex))
|
736
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_file.html", creole.to_doc(:html, @opt))
|
737
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_file.latex", creole.to_doc(:latex, @opt))
|
704
738
|
$log.warn('test_creole_links_file: to_context')
|
705
739
|
#~ assert_equal_filecontent( "expected_creole/test_creole_links_file.context", creole.to_doc(:context))
|
706
740
|
$log.warn('test_creole_links_file: to wiki/creole')
|
707
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_links_file.creole", creole.to_doc(:creole))
|
708
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_file.text", creole.to_doc(:text))
|
741
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_links_file.creole", creole.to_doc(:creole, @opt))
|
742
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_file.text", creole.to_doc(:text, @opt))
|
709
743
|
end #test_creole_links_file
|
710
744
|
|
711
745
|
def test_creole_links_explicit_internal()
|
712
|
-
creole = Creole.new(:content => <<creole
|
746
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
713
747
|
[[#internal]]
|
714
748
|
|
715
749
|
[[#internal|Links inside]]
|
716
750
|
creole
|
717
751
|
)
|
718
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.html", creole.to_doc(:html))
|
752
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.html", creole.to_doc(:html, @opt))
|
719
753
|
$log.warn('test_creole_links_explicit_internal: to latex')
|
720
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.latex", creole.to_doc(:latex))
|
754
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.latex", creole.to_doc(:latex, @opt))
|
721
755
|
$log.warn('test_creole_links_explicit_internal: to_context')
|
722
756
|
#~ #~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.context", creole.to_doc(:context))
|
723
757
|
$log.warn('test_creole_links_explicit_internal: to wiki/creole')
|
724
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.creole", creole.to_doc(:creole))
|
725
|
-
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.text", creole.to_doc(:text))
|
758
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.creole", creole.to_doc(:creole, @opt))
|
759
|
+
assert_equal_filecontent( "expected_creole/test_creole_links_explicit_internal.text", creole.to_doc(:text, @opt))
|
726
760
|
end #test_creole_links_explicit_internal
|
727
761
|
|
728
762
|
end #Test_creole_links
|
729
763
|
|
730
764
|
|
731
765
|
class Test_creole_pictures < Test::Unit::TestCase
|
766
|
+
def setup()
|
767
|
+
#Avoid warnings about missing logger in to_doc
|
768
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
769
|
+
end
|
732
770
|
def test_creole_pictures()
|
733
|
-
creole = Creole.new(:content => <<creole
|
771
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
734
772
|
This should be a flower with the ALT text "this is a flower" if your wiki supports ALT text on images:
|
735
773
|
|
736
774
|
{{Red_Flower.jpg}}
|
@@ -738,33 +776,33 @@ This should be a flower with the ALT text "this is a flower" if your wiki suppor
|
|
738
776
|
{{Red_Flower.jpg|here is a red flower}}
|
739
777
|
creole
|
740
778
|
)
|
741
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures.html", creole.to_doc(:html))
|
742
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures.latex", creole.to_doc(:latex))
|
779
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures.html", creole.to_doc(:html, @opt))
|
780
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures.latex", creole.to_doc(:latex, @opt))
|
743
781
|
$log.warn('test_creole_pictures: to_context')
|
744
782
|
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures.context", creole.to_doc(:context))
|
745
783
|
$log.warn('test_creole_pictures: to wiki/creole')
|
746
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures.creole", creole.to_doc(:creole))
|
784
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures.creole", creole.to_doc(:creole, @opt))
|
747
785
|
$log.warn('test_creole_pictures: to text/creole')
|
748
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures.text", creole.to_doc(:text))
|
786
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures.text", creole.to_doc(:text, @opt))
|
749
787
|
end #test_creole_pictures
|
750
788
|
def test_creole_picture_link()
|
751
|
-
creole = Creole.new(:name => 'Creole_picture_link',
|
789
|
+
creole = Docgenerator::Creole::Creole.new(:name => 'Creole_picture_link',
|
752
790
|
:content => <<creole
|
753
791
|
[[./#{$thisfile}|{{Red_Flower.jpg}}]] - if you click on the image, will goto "some link"
|
754
792
|
|
755
793
|
[[http://example.com/|{{Red_Flower.jpg}}]] - same as above: picture links to url
|
756
794
|
creole
|
757
795
|
)
|
758
|
-
assert_equal_filecontent( "expected_creole/test_creole_picture_link.html", creole.to_doc(:html))
|
759
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.latex", creole.to_doc(:latex))
|
796
|
+
assert_equal_filecontent( "expected_creole/test_creole_picture_link.html", creole.to_doc(:html, @opt))
|
797
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.latex", creole.to_doc(:latex, @opt))
|
760
798
|
$log.warn('test_creole_picture_link: to_context')
|
761
799
|
#~ #~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.context", creole.to_doc(:context))
|
762
800
|
$log.warn('test_creole_picture_link: to wiki/creole')
|
763
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.creole", creole.to_doc(:creole))
|
764
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.text", creole.to_doc(:text))
|
801
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.creole", creole.to_doc(:creole, @opt))
|
802
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_picture_link.text", creole.to_doc(:text, @opt))
|
765
803
|
end #test_creole_picture_link
|
766
804
|
def test_creole_pictures_css()
|
767
|
-
creole = Creole.new(
|
805
|
+
creole = Docgenerator::Creole::Creole.new(
|
768
806
|
:name => 'pictures_css',
|
769
807
|
:content => <<creole
|
770
808
|
{{Red_Flower.jpg|red flower|css=width:50px}}
|
@@ -772,17 +810,17 @@ creole
|
|
772
810
|
{{Red_Flower.jpg|red flower|imgcss=width:100px}}
|
773
811
|
creole
|
774
812
|
)
|
775
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures_css.html", creole.to_doc(:html))
|
776
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures_css.latex", creole.to_doc(:latex))
|
813
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures_css.html", creole.to_doc(:html, @opt))
|
814
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures_css.latex", creole.to_doc(:latex, @opt))
|
777
815
|
$log.warn('test_creole_pictures_css: to_context')
|
778
816
|
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.context", creole.to_doc(:context))
|
779
817
|
$log.warn('test_creole_pictures_css: to wiki/creole')
|
780
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.creole", creole.to_doc(:creole))
|
818
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.creole", creole.to_doc(:creole, @opt))
|
781
819
|
$log.warn('test_creole_pictures_css: to text/creole')
|
782
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.text", creole.to_doc(:text))
|
820
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_css.text", creole.to_doc(:text, @opt))
|
783
821
|
end #test_creole_pictures_css
|
784
822
|
def test_creole_pictures_imgclass()
|
785
|
-
creole = Creole.new(
|
823
|
+
creole = Docgenerator::Creole::Creole.new(
|
786
824
|
:name => 'pictures_imgclass',
|
787
825
|
:content => <<creole
|
788
826
|
{{Red_Flower.jpg||class=test}}
|
@@ -790,56 +828,60 @@ creole
|
|
790
828
|
{{Red_Flower.jpg||imgclass=test}}
|
791
829
|
creole
|
792
830
|
)
|
793
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.html", creole.to_doc(:html))
|
794
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.latex", creole.to_doc(:latex))
|
831
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.html", creole.to_doc(:html, @opt))
|
832
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.latex", creole.to_doc(:latex, @opt))
|
795
833
|
$log.warn('test_creole_pictures_imgclass: to_context')
|
796
834
|
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.context", creole.to_doc(:context))
|
797
835
|
$log.warn('test_creole_pictures_imgclass: to wiki/creole')
|
798
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.creole", creole.to_doc(:creole))
|
836
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.creole", creole.to_doc(:creole, @opt))
|
799
837
|
$log.warn('test_creole_pictures_imgclass: to text/creole')
|
800
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.text", creole.to_doc(:text))
|
838
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_imgclass.text", creole.to_doc(:text, @opt))
|
801
839
|
end #test_creole_pictures_imgclass
|
802
840
|
|
803
841
|
def test_creole_pictures_longdesc()
|
804
|
-
creole = Creole.new(
|
842
|
+
creole = Docgenerator::Creole::Creole.new(
|
805
843
|
:name => 'pictures_longdesc',
|
806
844
|
:content => <<creole
|
807
845
|
{{Red_Flower.jpg||longdesc=http://www.pixelio.de/details.php?image_id=405788}}
|
808
846
|
creole
|
809
847
|
)
|
810
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.html", creole.to_doc(:html))
|
811
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.latex", creole.to_doc(:latex))
|
848
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.html", creole.to_doc(:html, @opt))
|
849
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.latex", creole.to_doc(:latex, @opt))
|
812
850
|
#~ $log.warn('test_creole_pictures_longdesc: to_context')
|
813
851
|
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.context", creole.to_doc(:context))
|
814
852
|
$log.warn('test_creole_pictures_longdesc: to wiki/creole')
|
815
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.creole", creole.to_doc(:creole))
|
853
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.creole", creole.to_doc(:creole, @opt))
|
816
854
|
$log.warn('test_creole_pictures_longdesc: to text/creole')
|
817
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.text", creole.to_doc(:text))
|
855
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_longdesc.text", creole.to_doc(:text, @opt))
|
818
856
|
end #test_creole_pictures_longdesc
|
819
857
|
|
820
858
|
def test_creole_pictures_width()
|
821
|
-
creole = Creole.new(
|
859
|
+
creole = Docgenerator::Creole::Creole.new(
|
822
860
|
:name => 'pictures_width',
|
823
861
|
:content => <<creole
|
824
862
|
{{Red_Flower.jpg||width=\\textwidth|css=width:100%}}
|
825
863
|
creole
|
826
864
|
)
|
827
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures_width.html", creole.to_doc(:html))
|
828
|
-
assert_equal_filecontent( "expected_creole/test_creole_pictures_width.latex", creole.to_doc(:latex))
|
865
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures_width.html", creole.to_doc(:html, @opt))
|
866
|
+
assert_equal_filecontent( "expected_creole/test_creole_pictures_width.latex", creole.to_doc(:latex, @opt))
|
829
867
|
#~ $log.warn('test_creole_pictures_width: to_context')
|
830
868
|
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.context", creole.to_doc(:context))
|
831
869
|
$log.warn('test_creole_pictures_width: to wiki/creole')
|
832
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.creole", creole.to_doc(:creole))
|
870
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.creole", creole.to_doc(:creole, @opt))
|
833
871
|
$log.warn('test_creole_pictures_width: to text/creole')
|
834
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.text", creole.to_doc(:text))
|
872
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_pictures_width.text", creole.to_doc(:text, @opt))
|
835
873
|
end #test_creole_pictures_width
|
836
874
|
|
837
875
|
end #Test_creole_pictures
|
838
876
|
|
839
877
|
|
840
878
|
class Test_creole_verbatim < Test::Unit::TestCase
|
879
|
+
def setup()
|
880
|
+
#Avoid warnings about missing logger in to_doc
|
881
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
882
|
+
end
|
841
883
|
def test_creole_verbatim()
|
842
|
-
creole = Creole.new( :name => 'creole_verbatim',
|
884
|
+
creole = Docgenerator::Creole::Creole.new( :name => 'creole_verbatim',
|
843
885
|
:content => <<creole
|
844
886
|
You can use nowiki syntax if you would like do stuff like this:
|
845
887
|
|
@@ -863,17 +905,17 @@ after
|
|
863
905
|
See [[http://www.wikicreole.org/wiki/PreformattedAndNowiki]]
|
864
906
|
creole
|
865
907
|
)
|
866
|
-
assert_equal_filecontent( "expected_creole/test_creole_verbatim.html", creole.to_doc(:html))
|
867
|
-
assert_equal_filecontent( "expected_creole/test_creole_verbatim.latex", creole.to_doc(:latex))
|
908
|
+
assert_equal_filecontent( "expected_creole/test_creole_verbatim.html", creole.to_doc(:html, @opt))
|
909
|
+
assert_equal_filecontent( "expected_creole/test_creole_verbatim.latex", creole.to_doc(:latex, @opt))
|
868
910
|
$log.warn('test_creole_verbatim: to_context')
|
869
911
|
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim.context", creole.to_doc(:context))
|
870
912
|
$log.warn('test_creole_verbatim: change < to < ....')
|
871
913
|
$log.warn('test_creole_verbatim: to wiki/creole')
|
872
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim.creole", creole.to_doc(:creole))
|
873
|
-
assert_equal_filecontent( "expected_creole/test_creole_verbatim.text", creole.to_doc(:text))
|
914
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim.creole", creole.to_doc(:creole, @opt))
|
915
|
+
assert_equal_filecontent( "expected_creole/test_creole_verbatim.text", creole.to_doc(:text, @opt))
|
874
916
|
end #test_creole_verbatim
|
875
917
|
def test_creole_verbatim_inline()
|
876
|
-
creole = Creole.new(:content => <<creole
|
918
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
877
919
|
|
878
920
|
You can also use inline nowiki {{{ in a sentence }}} like this.
|
879
921
|
See [[http://www.wikicreole.org/wiki/PreformattedAndNowiki]].
|
@@ -881,16 +923,16 @@ See [[http://www.wikicreole.org/wiki/PreformattedAndNowiki]].
|
|
881
923
|
Some examples of markup are: {{{** <i>this</i> ** }}}
|
882
924
|
creole
|
883
925
|
)
|
884
|
-
assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.html", creole.to_doc(:html))
|
885
|
-
assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.latex", creole.to_doc(:latex))
|
926
|
+
assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.html", creole.to_doc(:html, @opt))
|
927
|
+
assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.latex", creole.to_doc(:latex, @opt))
|
886
928
|
$log.warn('test_creole_verbatim_inline: to_context')
|
887
929
|
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.context", creole.to_doc(:context))
|
888
930
|
$log.warn('test_creole_verbatim_inline: to wiki/creole')
|
889
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.creole", creole.to_doc(:creole))
|
890
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.text", creole.to_doc(:text))
|
931
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.creole", creole.to_doc(:creole, @opt))
|
932
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline.text", creole.to_doc(:text, @opt))
|
891
933
|
end #test_creole_verbatim_inline
|
892
934
|
def test_creole_verbatim_inline_at_start()
|
893
|
-
creole = Creole.new(
|
935
|
+
creole = Docgenerator::Creole::Creole.new(
|
894
936
|
:name => 'verbatim_inline_at_start',
|
895
937
|
:content => <<creole
|
896
938
|
Short verbatim can also be at the start:
|
@@ -899,201 +941,26 @@ Short verbatim can also be at the start:
|
|
899
941
|
This test checks, if the differences of normal verbatim is detected.
|
900
942
|
creole
|
901
943
|
)
|
902
|
-
assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.html", creole.to_doc(:html))
|
903
|
-
assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.latex", creole.to_doc(:latex))
|
944
|
+
assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.html", creole.to_doc(:html, @opt))
|
945
|
+
assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.latex", creole.to_doc(:latex, @opt))
|
904
946
|
$log.warn('test_creole_verbatim_inline_at_start: to_context')
|
905
947
|
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.context", creole.to_doc(:context))
|
906
948
|
$log.warn('test_creole_verbatim_inline_at_start: to wiki/creole')
|
907
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.creole", creole.to_doc(:creole))
|
949
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.creole", creole.to_doc(:creole, @opt))
|
908
950
|
$log.warn('test_creole_verbatim_inline_at_start: to text/creole')
|
909
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.text", creole.to_doc(:text))
|
951
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_verbatim_inline_at_start.text", creole.to_doc(:text, @opt))
|
910
952
|
end #test_creole_verbatim_inline_at_start
|
911
953
|
|
912
954
|
end #Test_creole_verbatim
|
913
955
|
|
914
|
-
class Test_creole_placeholders < Test::Unit::TestCase
|
915
|
-
def test_creole_placeholders()
|
916
|
-
creole = Creole.new(:content => <<creole
|
917
|
-
==Titel 1==
|
918
|
-
Text
|
919
|
-
creole
|
920
|
-
)
|
921
|
-
assert_equal( Creole::Placeholders, creole.placeholders)
|
922
|
-
assert_equal( Creole_dummy_placeholder, Creole::Placeholders[:undefined])
|
923
|
-
assert_equal( Creole_html, Creole::Placeholders['html'])
|
924
|
-
#~ assert_instance_of( Creole_dummy_placeholder, Creole::Placeholders[:undefined])
|
925
|
-
Creole::Placeholders.each{|key,placeholder_class|
|
926
|
-
assert_equal( placeholder_class, Creole::Placeholders[key])
|
927
|
-
assert_equal( placeholder_class, creole.placeholders[key])
|
928
|
-
|
929
|
-
placeholder = placeholder_class.new( Creole.new )
|
930
|
-
#Check inheratance.
|
931
|
-
assert_kind_of( Creole_placeholder, placeholder)
|
932
|
-
}
|
933
|
-
end #test_creole_placeholders
|
934
|
-
def test_creole_placeholders_html()
|
935
|
-
creole = Creole.new(:content => <<creole
|
936
|
-
before
|
937
|
-
<<<html
|
938
|
-
<em>this is only for HTML</em>
|
939
|
-
>>>
|
940
|
-
after
|
941
|
-
creole
|
942
|
-
)
|
943
|
-
#Really like this? Or should there be no paragraph?
|
944
|
-
assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.html", creole.to_doc(:html))
|
945
|
-
assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.latex", creole.to_doc(:latex))
|
946
|
-
$log.warn('test_creole_placeholders_html: to_context')
|
947
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.context", creole.to_doc(:context))
|
948
|
-
$log.warn('test_creole_placeholders_html: to wiki/creole')
|
949
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.creole", creole.to_doc(:creole))
|
950
|
-
assert_equal_filecontent( "expected_creole/test_creole_placeholders_html.text", creole.to_doc(:text))
|
951
|
-
end #test_creole_placeholders_html
|
952
|
-
def test_creole_placeholders_latex()
|
953
|
-
creole = Creole.new(:content => <<creole
|
954
|
-
before
|
955
|
-
<<<latex
|
956
|
-
\\textbf{this is only for latex}
|
957
|
-
>>>
|
958
|
-
after
|
959
|
-
creole
|
960
|
-
)
|
961
|
-
#Really like this? Or should there be no paragraph?
|
962
|
-
assert_equal_filecontent( "expected_creole/test_creole_placeholders_latex.html", creole.to_doc(:html))
|
963
|
-
assert_equal_filecontent( "expected_creole/test_creole_placeholders_latex.latex", creole.to_doc(:latex))
|
964
|
-
$log.warn('test_creole_placeholders_latex: to_context')
|
965
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_placeholders_context.context", creole.to_doc(:context))
|
966
|
-
$log.warn('test_creole_placeholders_latex: to wiki/creole')
|
967
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_placeholders_latex.creole", creole.to_doc(:creole))
|
968
|
-
assert_equal_filecontent( "expected_creole/test_creole_placeholders_latex.text", creole.to_doc(:text))
|
969
|
-
end #test_creole_placeholders_latex
|
970
|
-
|
971
|
-
end #Test_creole_placeholders
|
972
|
-
|
973
|
-
#http://www.wikicreole.org/wiki/Tables
|
974
|
-
class Test_creole_tabular < Test::Unit::TestCase
|
975
|
-
def test_creole_tabular_creole()
|
976
|
-
creole = Creole.new(
|
977
|
-
:name => 'tabular_creole',
|
978
|
-
:content => <<'creole'
|
979
|
-
Tables are done like this:
|
980
|
-
|=header col1|=header col2|
|
981
|
-
|col1|col2|
|
982
|
-
|you |can |
|
983
|
-
|also |align\\ it. |
|
984
|
-
creole
|
985
|
-
)
|
986
|
-
$log.warn('test_creole_tabular_creole: tabular inside paragraphs/list...')
|
987
|
-
$log.warn('test_creole_tabular_creole: wiki syntax inside cell ')
|
988
|
-
assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.html", creole.to_doc(:html))
|
989
|
-
assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.latex", creole.to_doc(:latex))
|
990
|
-
$log.warn('test_creole_tabular_creole: to_context')
|
991
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.context", creole.to_doc(:context))
|
992
|
-
$log.warn('test_creole_tabular_creole: to wiki/creole')
|
993
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.creole", creole.to_doc(:creole))
|
994
|
-
$log.warn('test_creole_tabular_creole: to text/creole')
|
995
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular_creole.text", creole.to_doc(:text))
|
996
|
-
end #test_creole_tabular_creole
|
997
|
-
|
998
|
-
def test_creole_tabular()
|
999
|
-
creole = Creole.new(:content => <<creole
|
1000
|
-
before
|
1001
|
-
<<<tabular
|
1002
|
-
|!columns=3
|
1003
|
-
|!columndescription=ccc
|
1004
|
-
|=1
|
1005
|
-
|=2
|
1006
|
-
|=3
|
1007
|
-
|-
|
1008
|
-
|eins
|
1009
|
-
|zwei
|
1010
|
-
|drei
|
1011
|
-
|-
|
1012
|
-
|one
|
1013
|
-
|two
|
1014
|
-
|three
|
1015
|
-
>>>
|
1016
|
-
after
|
1017
|
-
creole
|
1018
|
-
)
|
1019
|
-
assert_equal_filecontent( "expected_creole/test_creole_tabular.html", creole.to_doc(:html))
|
1020
|
-
assert_equal_filecontent( "expected_creole/test_creole_tabular.latex", creole.to_doc(:latex))
|
1021
|
-
$log.warn('test_creole_tabular: to_context')
|
1022
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular.context", creole.to_doc(:context))
|
1023
|
-
$log.warn('test_creole_tabular: to wiki/creole')
|
1024
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular.creole", creole.to_doc(:creole))
|
1025
|
-
$log.warn('test_creole_tabular: to text/creole')
|
1026
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular.text", creole.to_doc(:text))
|
1027
|
-
end #test_creole_tabular
|
1028
|
-
|
1029
|
-
def test_creole_tabular_with_cell_option()
|
1030
|
-
# title...
|
1031
|
-
creole = Creole.new(:content => <<creole
|
1032
|
-
before
|
1033
|
-
<<<tabular
|
1034
|
-
|!columns=3
|
1035
|
-
|eins||css=color: red
|
1036
|
-
|css = zwei
|
1037
|
-
|||class=empty
|
1038
|
-
|-
|
1039
|
-
|normal
|
1040
|
-
|//italic//
|
1041
|
-
|//italic//||class=it
|
1042
|
-
|-
|
1043
|
-
|text with | nice! ||class = it
|
1044
|
-
|||css =
|
1045
|
-
|
|
1046
|
-
>>>
|
1047
|
-
after
|
1048
|
-
creole
|
1049
|
-
)
|
1050
|
-
assert_equal_filecontent( "expected_creole/test_creole_tabular_with_cell_option.html", creole.to_doc(:html))
|
1051
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular_with_option.latex", creole.to_doc(:latex))
|
1052
|
-
$log.warn('test_creole_tabular: to_context')
|
1053
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular.context", creole.to_doc(:context))
|
1054
|
-
$log.warn('test_creole_tabular: to wiki/creole')
|
1055
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular.creole", creole.to_doc(:creole))
|
1056
|
-
$log.warn('test_creole_tabular: to text/creole')
|
1057
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular.text", creole.to_doc(:text))
|
1058
|
-
end #test_creole_tabular
|
1059
|
-
|
1060
|
-
def test_creole_tabular_css()
|
1061
|
-
creole = Creole.new(:content => <<creole
|
1062
|
-
before
|
1063
|
-
<<<tabular
|
1064
|
-
|!columns=3
|
1065
|
-
|!columndescription=ccc
|
1066
|
-
|!css=border-width: 1px
|
1067
|
-
|!css=border-style: solid
|
1068
|
-
|=1
|
1069
|
-
|=2
|
1070
|
-
|=3
|
1071
|
-
|-
|
1072
|
-
|eins
|
1073
|
-
|zwei
|
1074
|
-
|drei
|
1075
|
-
|-
|
1076
|
-
|one
|
1077
|
-
|two
|
1078
|
-
|three
|
1079
|
-
>>>
|
1080
|
-
after
|
1081
|
-
creole
|
1082
|
-
)
|
1083
|
-
assert_equal_filecontent( "expected_creole/test_creole_tabular_css.html", creole.to_doc(:html))
|
1084
|
-
assert_equal_filecontent( "expected_creole/test_creole_tabular_css.latex", creole.to_doc(:latex))
|
1085
|
-
$log.warn('test_creole_tabular_css: to_context')
|
1086
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular_css.context", creole.to_doc(:context))
|
1087
|
-
$log.warn('test_creole_tabular_css: to wiki/creole')
|
1088
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular_css.creole", creole.to_doc(:creole))
|
1089
|
-
$log.warn('test_creole_tabular_css: to text/creole')
|
1090
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_tabular_css.text", creole.to_doc(:text))
|
1091
|
-
end #test_creole_tabular_css
|
1092
|
-
end #Test_creole_tabular
|
1093
956
|
|
1094
957
|
class Test_creole_footnote < Test::Unit::TestCase
|
958
|
+
def setup()
|
959
|
+
#Avoid warnings about missing logger in to_doc
|
960
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
961
|
+
end
|
1095
962
|
def test_creole_footnotes()
|
1096
|
-
creole = Creole.new(
|
963
|
+
creole = Docgenerator::Creole::Creole.new(
|
1097
964
|
:name => 'footnotes',
|
1098
965
|
:content => <<creole
|
1099
966
|
<<footnote|This is a footnote>>
|
@@ -1101,17 +968,17 @@ class Test_creole_footnote < Test::Unit::TestCase
|
|
1101
968
|
<<footnotes>>
|
1102
969
|
creole
|
1103
970
|
)
|
1104
|
-
assert_equal_filecontent( "expected_creole/test_creole_footnotes.html", creole.to_doc(:html))
|
1105
|
-
assert_equal_filecontent( "expected_creole/test_creole_footnotes.latex", creole.to_doc(:latex))
|
971
|
+
assert_equal_filecontent( "expected_creole/test_creole_footnotes.html", creole.to_doc(:html, @opt))
|
972
|
+
assert_equal_filecontent( "expected_creole/test_creole_footnotes.latex", creole.to_doc(:latex, @opt))
|
1106
973
|
$log.warn('test_creole_footnotes: to_context')
|
1107
974
|
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.context", creole.to_doc(:context))
|
1108
975
|
$log.warn('test_creole_footnotes: to wiki/creole')
|
1109
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.creole", creole.to_doc(:creole))
|
976
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.creole", creole.to_doc(:creole, @opt))
|
1110
977
|
$log.warn('test_creole_footnotes: to text/creole')
|
1111
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.text", creole.to_doc(:text))
|
978
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes.text", creole.to_doc(:text, @opt))
|
1112
979
|
end #test_creole_footnotes
|
1113
980
|
def test_creole_footnotes_label()
|
1114
|
-
creole = Creole.new(
|
981
|
+
creole = Docgenerator::Creole::Creole.new(
|
1115
982
|
:name => 'footnotes_label',
|
1116
983
|
:content => <<creole
|
1117
984
|
<<footnote|This is a footnote|label=s>>
|
@@ -1120,16 +987,37 @@ This makes only sense in HTML
|
|
1120
987
|
<<footnotes>>
|
1121
988
|
creole
|
1122
989
|
)
|
1123
|
-
assert_equal_filecontent( "expected_creole
|
1124
|
-
#~ assert_equal_filecontent( "expected_creole
|
1125
|
-
$log.warn('test_creole_footnotes_label: to_context')
|
1126
|
-
#~ #~ assert_equal_filecontent( "expected_creole
|
990
|
+
assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html, @opt))
|
991
|
+
#~ assert_equal_filecontent( "expected_creole/#{__method__}.latex", creole.to_doc(:latex, @opt))
|
992
|
+
#~ $log.warn('test_creole_footnotes_label: to_context')
|
993
|
+
#~ #~ assert_equal_filecontent( "expected_creole/#{__method__}.context", creole.to_doc(:context))
|
1127
994
|
#~ $log.warn('test_creole_footnotes_label: to wiki/creole')
|
1128
|
-
#~ assert_equal_filecontent( "expected_creole
|
995
|
+
#~ assert_equal_filecontent( "expected_creole/#{__method__}.creole", creole.to_doc(:creole, @opt))
|
1129
996
|
#~ $log.warn('test_creole_footnotes_label: to text/creole')
|
1130
|
-
#~ assert_equal_filecontent( "expected_creole
|
997
|
+
#~ assert_equal_filecontent( "expected_creole/#{__method__}.text", creole.to_doc(:text, @opt))
|
1131
998
|
end #test_creole_footnotes_label
|
1132
999
|
|
1000
|
+
def test_creole_footnotes_groupid()
|
1001
|
+
creole = Docgenerator::Creole::Creole.new(
|
1002
|
+
:name => 'footnotes_group',
|
1003
|
+
:content => <<creole
|
1004
|
+
Text<<footnote|This is a footnote|>>
|
1005
|
+
more text<<footnote|This is a footnote in group g1|groupid=g1>>
|
1006
|
+
----
|
1007
|
+
<<footnotes>>
|
1008
|
+
----
|
1009
|
+
<<footnotes|g1>>
|
1010
|
+
creole
|
1011
|
+
)
|
1012
|
+
assert_equal_filecontent( "expected_creole/#{__method__}.html", creole.to_doc(:html, @opt))
|
1013
|
+
#~ assert_equal_filecontent( "expected_creole/#{__method__}.latex", creole.to_doc(:latex, @opt))
|
1014
|
+
#~ $log.warn('test_creole_footnotes_label: to_context')
|
1015
|
+
#~ #~ assert_equal_filecontent( "expected_creole/#{__method__}.context", creole.to_doc(:context))
|
1016
|
+
#~ $log.warn('test_creole_footnotes_label: to wiki/creole')
|
1017
|
+
#~ assert_equal_filecontent( "expected_creole/#{__method__}l.creole", creole.to_doc(:creole, @opt))
|
1018
|
+
#~ $log.warn('test_creole_footnotes_label: to text/creole')
|
1019
|
+
#~ assert_equal_filecontent( "expected_creole/#{__method__}.text", creole.to_doc(:text, @opt))
|
1020
|
+
end #test_creole_footnotes_label
|
1133
1021
|
=begin rdoc
|
1134
1022
|
Footnotes in tabulars don't work.
|
1135
1023
|
=end
|
@@ -1137,7 +1025,7 @@ Footnotes in tabulars don't work.
|
|
1137
1025
|
return
|
1138
1026
|
#check for warning?
|
1139
1027
|
|
1140
|
-
creole = Creole.new(
|
1028
|
+
creole = Docgenerator::Creole::Creole.new(
|
1141
1029
|
:name => 'footnotes',
|
1142
1030
|
:content => <<creole
|
1143
1031
|
<<<tabular
|
@@ -1149,55 +1037,68 @@ Footnotes in tabulars don't work.
|
|
1149
1037
|
creole
|
1150
1038
|
)
|
1151
1039
|
$log.warn('test_creole_footnotes_in_tabular: html')
|
1152
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.html", creole.to_doc(:html))
|
1153
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.latex", creole.to_doc(:latex))
|
1040
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.html", creole.to_doc(:html, @opt))
|
1041
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.latex", creole.to_doc(:latex, @opt))
|
1154
1042
|
#~ $log.warn('test_creole_footnotes_in_tabular: to_context')
|
1155
1043
|
#~ #~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.context", creole.to_doc(:context))
|
1156
1044
|
#~ $log.warn('test_creole_footnotes_in_tabular: to wiki/creole')
|
1157
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.creole", creole.to_doc(:creole))
|
1045
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.creole", creole.to_doc(:creole, @opt))
|
1158
1046
|
#~ $log.warn('test_creole_footnotes_in_tabular: to text/creole')
|
1159
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.text", creole.to_doc(:text))
|
1047
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_footnotes_in_tabular.text", creole.to_doc(:text, @opt))
|
1160
1048
|
end #test_creole_footnotes_in_tabular
|
1161
1049
|
end #Test_creole_footnote
|
1162
1050
|
|
1163
1051
|
class Test_creole_short_html < Test::Unit::TestCase
|
1052
|
+
def setup()
|
1053
|
+
#Avoid warnings about missing logger in to_doc
|
1054
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
1055
|
+
end
|
1164
1056
|
def test_creole_short_html()
|
1165
|
-
creole = Creole.new(:content => <<creole
|
1057
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
1166
1058
|
before
|
1167
1059
|
{{html|<em>this is only for HTML</em>}}
|
1168
1060
|
after
|
1169
1061
|
creole
|
1170
1062
|
)
|
1171
1063
|
#Really like this? Or should there be no paragraph?
|
1172
|
-
assert_equal_filecontent( "expected_creole/test_creole_short_html.html", creole.to_doc(:html))
|
1173
|
-
assert_equal_filecontent( "expected_creole/test_creole_short_html.latex", creole.to_doc(:latex))
|
1064
|
+
assert_equal_filecontent( "expected_creole/test_creole_short_html.html", creole.to_doc(:html, @opt))
|
1065
|
+
assert_equal_filecontent( "expected_creole/test_creole_short_html.latex", creole.to_doc(:latex, @opt))
|
1174
1066
|
$log.warn('test_creole_short_html: to_context')
|
1175
1067
|
#~ assert_equal_filecontent( "expected_creole/test_creole_short_html.context", creole.to_doc(:context))
|
1176
1068
|
$log.warn('test_creole_short_html: to wiki/creole')
|
1177
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_short_html.creole", creole.to_doc(:creole))
|
1178
|
-
assert_equal_filecontent( "expected_creole/test_creole_short_html.text", creole.to_doc(:text))
|
1069
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_short_html.creole", creole.to_doc(:creole, @opt))
|
1070
|
+
assert_equal_filecontent( "expected_creole/test_creole_short_html.text", creole.to_doc(:text, @opt))
|
1179
1071
|
end #test_creole_short_html
|
1180
1072
|
end #Test_creole_short_html
|
1181
1073
|
|
1182
1074
|
|
1183
1075
|
class Test_creole_characters < Test::Unit::TestCase
|
1076
|
+
def setup()
|
1077
|
+
#Avoid warnings about missing logger in to_doc
|
1078
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
1079
|
+
end
|
1184
1080
|
def test_creole_characters_all()
|
1185
|
-
creole = Creole.new(
|
1081
|
+
creole = Docgenerator::Creole::Creole.new(
|
1186
1082
|
:name => 'characters_all',
|
1187
|
-
:content => Creole::CHARACTERS.keys.sort.map{|char| "*#{char}" }.join("\n")
|
1083
|
+
#~ :content => Creole::CHARACTERS.keys.sort.map{|char| "*#{char}" }.join("\n")
|
1084
|
+
:content => Docgenerator::Creole::Creole::CHARACTERS.sort.map{|char, o| "* #{o.class}: #{char}"}.join("\n")
|
1188
1085
|
)
|
1189
|
-
self.readoption = 'r:
|
1190
|
-
assert_equal_filecontent( "expected_creole/test_creole_characters_all.html", creole.to_doc(:html))
|
1191
|
-
|
1086
|
+
self.readoption = 'r:cp1252'
|
1087
|
+
assert_equal_filecontent( "expected_creole/test_creole_characters_all.html", creole.to_doc(:html, @opt))
|
1088
|
+
|
1089
|
+
$log.warn('test_creole_characters_all: to_latex Dollar Missing escape mechanism')
|
1090
|
+
assert_equal_filecontent( "expected_creole/test_creole_characters_all.latex", creole.to_doc(:latex, @opt))
|
1192
1091
|
$log.warn('test_creole_characters_all: to_context')
|
1193
1092
|
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.context", creole.to_doc(:context))
|
1194
1093
|
$log.warn('test_creole_characters_all: to wiki/creole')
|
1195
|
-
#~
|
1094
|
+
#~ assert_equal(creole.source.join , creole.to_doc(:creole, @opt))
|
1095
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.creole", creole.source.join)
|
1096
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.creole", creole.to_doc(:creole, @opt))
|
1196
1097
|
$log.warn('test_creole_characters_all: to text/creole')
|
1197
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.text", creole.to_doc(:text))
|
1098
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_all.text", creole.to_doc(:text, @opt))
|
1198
1099
|
end #test_creole_characters_all
|
1199
1100
|
def test_creole_characters_special()
|
1200
|
-
creole = Creole.new(
|
1101
|
+
creole = Docgenerator::Creole::Creole.new(
|
1201
1102
|
:name => 'characters_special',
|
1202
1103
|
:content => <<creole
|
1203
1104
|
Special Characters:
|
@@ -1208,19 +1109,19 @@ Special Characters:
|
|
1208
1109
|
*_ Underscore
|
1209
1110
|
creole
|
1210
1111
|
)
|
1211
|
-
assert_equal_filecontent( "expected_creole/test_creole_characters_special.html", creole.to_doc(:html))
|
1212
|
-
assert_equal_filecontent( "expected_creole/test_creole_characters_special.latex", creole.to_doc(:latex))
|
1112
|
+
assert_equal_filecontent( "expected_creole/test_creole_characters_special.html", creole.to_doc(:html, @opt))
|
1113
|
+
assert_equal_filecontent( "expected_creole/test_creole_characters_special.latex", creole.to_doc(:latex, @opt))
|
1213
1114
|
$log.warn('test_creole_characters_special: to_context')
|
1214
1115
|
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.context", creole.to_doc(:context))
|
1215
1116
|
$log.warn('test_creole_characters_special: to wiki/creole')
|
1216
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.creole", creole.to_doc(:creole))
|
1117
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.creole", creole.to_doc(:creole, @opt))
|
1217
1118
|
$log.warn('test_creole_characters_special: to text/creole')
|
1218
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.text", creole.to_doc(:text))
|
1119
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_characters_special.text", creole.to_doc(:text, @opt))
|
1219
1120
|
end #test_creole_characters_special
|
1220
1121
|
|
1221
1122
|
#This is also a test for multiple inclusions in one line.
|
1222
1123
|
def test_creole_shy()
|
1223
|
-
creole = Creole.new(
|
1124
|
+
creole = Docgenerator::Creole::Creole.new(
|
1224
1125
|
:name => 'shy',
|
1225
1126
|
:content => <<creole
|
1226
1127
|
Donau{{shy}}dampf{{shy}}schiff{{shy}}fahrt
|
@@ -1228,22 +1129,26 @@ Donau{{shy}}dampf{{shy}}schiff{{shy}}fahrt
|
|
1228
1129
|
Donau{{-}}dampf{{-}}schiff{{-}}fahrt
|
1229
1130
|
creole
|
1230
1131
|
)
|
1231
|
-
assert_equal_filecontent( "expected_creole/test_creole_shy.html", creole.to_doc(:html))
|
1232
|
-
assert_equal_filecontent( "expected_creole/test_creole_shy.latex", creole.to_doc(:latex))
|
1132
|
+
assert_equal_filecontent( "expected_creole/test_creole_shy.html", creole.to_doc(:html, @opt))
|
1133
|
+
assert_equal_filecontent( "expected_creole/test_creole_shy.latex", creole.to_doc(:latex, @opt))
|
1233
1134
|
$log.warn('test_creole_shy: to_context')
|
1234
1135
|
#~ assert_equal_filecontent( "expected_creole/test_creole_shy.context", creole.to_doc(:context))
|
1235
|
-
assert_equal_filecontent( "expected_creole/test_creole_shy.creole", creole.to_doc(:creole))
|
1236
|
-
assert_equal_filecontent( "expected_creole/test_creole_shy.text", creole.to_doc(:text))
|
1136
|
+
assert_equal_filecontent( "expected_creole/test_creole_shy.creole", creole.to_doc(:creole, @opt))
|
1137
|
+
assert_equal_filecontent( "expected_creole/test_creole_shy.text", creole.to_doc(:text, @opt))
|
1237
1138
|
end #test_creole_shy
|
1238
1139
|
|
1239
1140
|
end #Test_creole_characters
|
1240
1141
|
|
1241
1142
|
class Test_creole_inline_ruby < Test::Unit::TestCase
|
1143
|
+
def setup()
|
1144
|
+
#Avoid warnings about missing logger in to_doc
|
1145
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
1146
|
+
end
|
1242
1147
|
def self.ruby_test()
|
1243
1148
|
return '*hallo welt'
|
1244
1149
|
end
|
1245
1150
|
def test_creole_inline_ruby_raw()
|
1246
|
-
creole = Creole.new(
|
1151
|
+
creole = Docgenerator::Creole::Creole.new(
|
1247
1152
|
:name => 'inline_ruby_raw',
|
1248
1153
|
:content => <<creole
|
1249
1154
|
The following Rubycode is added as raw text.
|
@@ -1252,17 +1157,17 @@ The following Rubycode is added as raw text.
|
|
1252
1157
|
<<ruby_raw|Test_creole_inline_ruby::ruby_test>>
|
1253
1158
|
creole
|
1254
1159
|
)
|
1255
|
-
assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.html", creole.to_doc(:html))
|
1256
|
-
assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.latex", creole.to_doc(:latex))
|
1160
|
+
assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.html", creole.to_doc(:html, @opt))
|
1161
|
+
assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.latex", creole.to_doc(:latex, @opt))
|
1257
1162
|
$log.warn('test_creole_inline_ruby_raw: to_context')
|
1258
1163
|
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.context", creole.to_doc(:context))
|
1259
1164
|
$log.warn('test_creole_inline_ruby_raw: to wiki/creole')
|
1260
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.creole", creole.to_doc(:creole))
|
1165
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.creole", creole.to_doc(:creole, @opt))
|
1261
1166
|
$log.warn('test_creole_inline_ruby_raw: to text/creole')
|
1262
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.text", creole.to_doc(:text))
|
1167
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby_raw.text", creole.to_doc(:text, @opt))
|
1263
1168
|
end #test_creole_inline_ruby_raw
|
1264
1169
|
def test_creole_inline_ruby()
|
1265
|
-
creole = Creole.new(
|
1170
|
+
creole = Docgenerator::Creole::Creole.new(
|
1266
1171
|
:name => 'inline_ruby',
|
1267
1172
|
:content => <<creole
|
1268
1173
|
The following ruby code is added and parsed by the wiki.
|
@@ -1270,37 +1175,41 @@ The following ruby code is added and parsed by the wiki.
|
|
1270
1175
|
<<ruby|Test_creole_inline_ruby::ruby_test>>
|
1271
1176
|
creole
|
1272
1177
|
)
|
1273
|
-
assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.html", creole.to_doc(:html))
|
1274
|
-
assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.latex", creole.to_doc(:latex))
|
1178
|
+
assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.html", creole.to_doc(:html, @opt))
|
1179
|
+
assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.latex", creole.to_doc(:latex, @opt))
|
1275
1180
|
$log.warn('test_creole_inline_ruby: to_context')
|
1276
1181
|
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.context", creole.to_doc(:context))
|
1277
1182
|
$log.warn('test_creole_inline_ruby: to wiki/creole')
|
1278
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.creole", creole.to_doc(:creole))
|
1183
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.creole", creole.to_doc(:creole, @opt))
|
1279
1184
|
$log.warn('test_creole_inline_ruby: to text/creole')
|
1280
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.text", creole.to_doc(:text))
|
1185
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_inline_ruby.text", creole.to_doc(:text, @opt))
|
1281
1186
|
end #test_creole_inline_ruby
|
1282
1187
|
def test_creole_countdown()
|
1283
|
-
creole = Creole.new(
|
1188
|
+
creole = Docgenerator::Creole::Creole.new(
|
1284
1189
|
:name => 'countdown',
|
1285
1190
|
:content => <<creole
|
1286
1191
|
Countdown: <<ruby_raw|(1..10).to_a.reverse.join("-")>>
|
1287
1192
|
creole
|
1288
1193
|
)
|
1289
|
-
assert_equal_filecontent( "expected_creole/test_creole_countdown.html", creole.to_doc(:html))
|
1290
|
-
assert_equal_filecontent( "expected_creole/test_creole_countdown.latex", creole.to_doc(:latex))
|
1194
|
+
assert_equal_filecontent( "expected_creole/test_creole_countdown.html", creole.to_doc(:html, @opt))
|
1195
|
+
assert_equal_filecontent( "expected_creole/test_creole_countdown.latex", creole.to_doc(:latex, @opt))
|
1291
1196
|
$log.warn('test_creole_countdown: to_context')
|
1292
1197
|
#~ assert_equal_filecontent( "expected_creole/test_creole_countdown.context", creole.to_doc(:context))
|
1293
1198
|
$log.warn('test_creole_countdown: to wiki/creole')
|
1294
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_countdown.creole", creole.to_doc(:creole))
|
1199
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_countdown.creole", creole.to_doc(:creole, @opt))
|
1295
1200
|
$log.warn('test_creole_countdown: to text/creole')
|
1296
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_countdown.text", creole.to_doc(:text))
|
1201
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_countdown.text", creole.to_doc(:text, @opt))
|
1297
1202
|
end #test_creole_countdown
|
1298
1203
|
|
1299
1204
|
end #Test_creole_inline_ruby
|
1300
1205
|
|
1301
1206
|
class Test_creole_ignore < Test::Unit::TestCase
|
1207
|
+
def setup()
|
1208
|
+
#Avoid warnings about missing logger in to_doc
|
1209
|
+
@opt = { :log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER }
|
1210
|
+
end
|
1302
1211
|
def test_creole_ignore()
|
1303
|
-
creole = Creole.new(
|
1212
|
+
creole = Docgenerator::Creole::Creole.new(
|
1304
1213
|
:name => 'ignore',
|
1305
1214
|
:ignore => /^#~.*$/,
|
1306
1215
|
:log => $tmplog, #catch info about comment
|
@@ -1310,17 +1219,17 @@ Text
|
|
1310
1219
|
more text
|
1311
1220
|
creole
|
1312
1221
|
)
|
1313
|
-
assert_equal_filecontent( "expected_creole/test_creole_ignore.html", creole.to_doc(:html))
|
1314
|
-
assert_equal_filecontent( "expected_creole/test_creole_ignore.latex", creole.to_doc(:latex))
|
1222
|
+
assert_equal_filecontent( "expected_creole/test_creole_ignore.html", creole.to_doc(:html, @opt))
|
1223
|
+
assert_equal_filecontent( "expected_creole/test_creole_ignore.latex", creole.to_doc(:latex, @opt))
|
1315
1224
|
$log.warn('test_creole_ignore: to_context')
|
1316
1225
|
#~ assert_equal_filecontent( "expected_creole/test_creole_ignore.context", creole.to_doc(:context))
|
1317
1226
|
$log.warn('test_creole_ignore: to wiki/creole')
|
1318
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_ignore.creole", creole.to_doc(:creole))
|
1319
|
-
assert_equal_filecontent( "expected_creole/test_creole_ignore.text", creole.to_doc(:text))
|
1227
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_ignore.creole", creole.to_doc(:creole, @opt))
|
1228
|
+
assert_equal_filecontent( "expected_creole/test_creole_ignore.text", creole.to_doc(:text, @opt))
|
1320
1229
|
end #test_creole_ignore
|
1321
1230
|
|
1322
1231
|
def test_creole_comment()
|
1323
|
-
creole = Creole.new(
|
1232
|
+
creole = Docgenerator::Creole::Creole.new(
|
1324
1233
|
:name => 'comment',
|
1325
1234
|
:content => <<creole
|
1326
1235
|
==Titel 1==
|
@@ -1332,13 +1241,13 @@ It's part of the document, but not visible to readers.
|
|
1332
1241
|
Text after
|
1333
1242
|
creole
|
1334
1243
|
)
|
1335
|
-
assert_equal_filecontent( "expected_creole/test_creole_comment.html", creole.to_doc(:html))
|
1336
|
-
assert_equal_filecontent( "expected_creole/test_creole_comment.latex", creole.to_doc(:latex))
|
1244
|
+
assert_equal_filecontent( "expected_creole/test_creole_comment.html", creole.to_doc(:html, @opt))
|
1245
|
+
assert_equal_filecontent( "expected_creole/test_creole_comment.latex", creole.to_doc(:latex, @opt))
|
1337
1246
|
assert_equal_filecontent( "expected_creole/test_creole_comment.context", creole.to_doc(:context))
|
1338
|
-
assert_equal_filecontent( "expected_creole/test_creole_comment.creole", creole.to_doc(:creole))
|
1339
|
-
#~ assert_raise( RuntimeError ) { creole.to_doc(:text) }
|
1247
|
+
assert_equal_filecontent( "expected_creole/test_creole_comment.creole", creole.to_doc(:creole, @opt))
|
1248
|
+
#~ assert_raise( RuntimeError ) { creole.to_doc(:text, @opt) }
|
1340
1249
|
$log.warn('test_creole_comment: to text')
|
1341
|
-
#~ assert_equal_filecontent( "expected_creole/test_creole_comment.text", creole.to_doc(:text))
|
1250
|
+
#~ assert_equal_filecontent( "expected_creole/test_creole_comment.text", creole.to_doc(:text, @opt))
|
1342
1251
|
end #test_creole_comment
|
1343
1252
|
|
1344
1253
|
end #Test_creole_ignore
|
@@ -1349,20 +1258,20 @@ def newtest(text, with_class = false )
|
|
1349
1258
|
code << "class Test_creole_#{text} < Test::Unit::TestCase\n" if with_class
|
1350
1259
|
code << <<code
|
1351
1260
|
def test_creole_#{text}()
|
1352
|
-
creole = Creole.new(
|
1261
|
+
creole = Docgenerator::Creole::Creole.new(
|
1353
1262
|
:name => '#{text}',
|
1354
1263
|
:content => <<creole
|
1355
1264
|
==Titel 1==
|
1356
1265
|
Text
|
1357
1266
|
creole
|
1358
1267
|
)
|
1359
|
-
assert_equal_filecontent( "expected_creole/test_creole_#{text}.html", creole.to_doc(:html))
|
1360
|
-
assert_equal_filecontent( "expected_creole/test_creole_#{text}.latex", creole.to_doc(:latex))
|
1268
|
+
assert_equal_filecontent( "expected_creole/test_creole_#{text}.html", creole.to_doc(:html, @opt))
|
1269
|
+
assert_equal_filecontent( "expected_creole/test_creole_#{text}.latex", creole.to_doc(:latex, @opt))
|
1361
1270
|
$log.warn('test_creole_#{text}: to_context')
|
1362
1271
|
#~ assert_equal_filecontent( "expected_creole/test_creole_#{text}.context", creole.to_doc(:context))
|
1363
1272
|
$log.warn('test_creole_#{text}: to wiki/creole')
|
1364
|
-
assert_equal_filecontent( "expected_creole/test_creole_#{text}.creole", creole.to_doc(:creole))
|
1365
|
-
assert_equal_filecontent( "expected_creole/test_creole_#{text}.text", creole.to_doc(:text))
|
1273
|
+
assert_equal_filecontent( "expected_creole/test_creole_#{text}.creole", creole.to_doc(:creole, @opt))
|
1274
|
+
assert_equal_filecontent( "expected_creole/test_creole_#{text}.text", creole.to_doc(:text, @opt))
|
1366
1275
|
end #test_creole_#{text}
|
1367
1276
|
code
|
1368
1277
|
code << "end #Test_creole_#{text}\n" if with_class
|
@@ -1390,18 +1299,18 @@ Meine Erweiterungen
|
|
1390
1299
|
--------------------------------------------
|
1391
1300
|
|
1392
1301
|
def test_creole_amazon()
|
1393
|
-
creole = Creole.new(:content => <<creole
|
1302
|
+
creole = Docgenerator::Creole::Creole.new(:content => <<creole
|
1394
1303
|
{{amazon|asin=B000AFEJAM}}
|
1395
1304
|
|
1396
1305
|
{{amazon|asin=B000AFEJAM|right}}
|
1397
1306
|
creole
|
1398
1307
|
)
|
1399
|
-
assert_equal_filecontent( "expected_creole/test_creole_amazon.html", creole.to_doc(:html))
|
1400
|
-
assert_equal_filecontent( "expected_creole/test_creole_amazon.latex", creole.to_doc(:latex))
|
1308
|
+
assert_equal_filecontent( "expected_creole/test_creole_amazon.html", creole.to_doc(:html, @opt))
|
1309
|
+
assert_equal_filecontent( "expected_creole/test_creole_amazon.latex", creole.to_doc(:latex, @opt))
|
1401
1310
|
$log.warn('test_creole_amazon: to_context')
|
1402
1311
|
#~ assert_equal_filecontent( "expected_creole/test_creole_amazon.context", creole.to_doc(:context))
|
1403
|
-
assert_equal_filecontent( "expected_creole/test_creole_amazon.creole", creole.to_doc(:creole))
|
1404
|
-
assert_equal_filecontent( "expected_creole/test_creole_amazon.text", creole.to_doc(:text))
|
1312
|
+
assert_equal_filecontent( "expected_creole/test_creole_amazon.creole", creole.to_doc(:creole, @opt))
|
1313
|
+
assert_equal_filecontent( "expected_creole/test_creole_amazon.text", creole.to_doc(:text, @opt))
|
1405
1314
|
end
|
1406
1315
|
|
1407
1316
|
Option :ignore
|