summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2017-06-24 17:24:17 -0600
committerDan Allen <dan.j.allen@gmail.com>2017-06-24 17:24:17 -0600
commit860dffbca633a922fcfbc1be9f2cf11b26908eca (patch)
tree596c90143d103ff11d3a37a641d3dd09ade33713
parent41169d970674102b904267ba95188c916e749e4d (diff)
use render_embedded_string method instead of setting header_footer option to false
-rw-r--r--test/document_test.rb2
-rw-r--r--test/reader_test.rb14
-rw-r--r--test/sections_test.rb4
3 files changed, 10 insertions, 10 deletions
diff --git a/test/document_test.rb b/test/document_test.rb
index fe8da2ea..39317b29 100644
--- a/test/document_test.rb
+++ b/test/document_test.rb
@@ -2292,7 +2292,7 @@ asciidoctor - converts AsciiDoc source files to HTML, DocBook and other formats
*asciidoctor* ['OPTION']... 'FILE'..
EOS
- output = render_string input, :header_footer => false
+ output = render_embedded_string input
assert_xpath '/h1[text()="asciidoctor(1) Manual Page"]', output, 1
assert_xpath '/h1/following-sibling::h2[text()="NAME"]', output, 1
assert_xpath '/h2[text()="NAME"]/following-sibling::*[@class="sectionbody"]', output, 1
diff --git a/test/reader_test.rb b/test/reader_test.rb
index 9ca79371..5a19df8a 100644
--- a/test/reader_test.rb
+++ b/test/reader_test.rb
@@ -709,7 +709,7 @@ include::#{url}[]
include::fixtures/include-file.asciidoc[lines=1;3..4;6..-1]
EOS
- output = render_string input, :safe => :safe, :header_footer => false, :base_dir => DIRNAME
+ output = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
assert_match(/first line/, output)
refute_match(/second line/, output)
assert_match(/third line/, output)
@@ -726,7 +726,7 @@ include::fixtures/include-file.asciidoc[lines=1;3..4;6..-1]
include::fixtures/include-file.asciidoc[lines="1, 3..4 , 6 .. -1"]
EOS
- output = render_string input, :safe => :safe, :header_footer => false, :base_dir => DIRNAME
+ output = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
assert_match(/first line/, output)
refute_match(/second line/, output)
assert_match(/third line/, output)
@@ -755,7 +755,7 @@ include::fixtures/include-file.asciidoc[lines=]
include::fixtures/include-file.asciidoc[tag=snippetA]
EOS
- output = render_string input, :safe => :safe, :header_footer => false, :base_dir => DIRNAME
+ output = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
assert_match(/snippetA content/, output)
refute_match(/snippetB content/, output)
refute_match(/non-tagged content/, output)
@@ -767,7 +767,7 @@ include::fixtures/include-file.asciidoc[tag=snippetA]
include::fixtures/include-file.asciidoc[tags=snippetA;snippetB]
EOS
- output = render_string input, :safe => :safe, :header_footer => false, :base_dir => DIRNAME
+ output = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
assert_match(/snippetA content/, output)
assert_match(/snippetB content/, output)
refute_match(/non-tagged content/, output)
@@ -946,7 +946,7 @@ include::fixtures/include-file.asciidoc[tag=snippetZ]
old_stderr = $stderr
$stderr = StringIO.new
begin
- render_string input, :safe => :safe, :header_footer => false, :base_dir => DIRNAME
+ render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
warning = $stderr.tap(&:rewind).read
refute_nil warning
assert_match(/WARNING.*snippetZ/, warning)
@@ -988,7 +988,7 @@ include::fixtures/include-file.xml[#{attr_name}=]
include::fixtures/include-file.asciidoc[lines=1, tags=snippetA;snippetB]
EOS
- output = render_string input, :safe => :safe, :header_footer => false, :base_dir => DIRNAME
+ output = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
assert_match(/first line of included content/, output)
refute_match(/snippetA content/, output)
refute_match(/snippetB content/, output)
@@ -1002,7 +1002,7 @@ include::fixtures/basic-docinfo.xml[lines=2..3, indent=0]
----
EOS
- output = render_string input, :safe => :safe, :header_footer => false, :base_dir => DIRNAME
+ output = render_embedded_string input, :safe => :safe, :base_dir => DIRNAME
result = xmlnodes_at_xpath('//pre', output, 1).text
assert_equal "<year>2013</year>\n<holder>Acme™, Inc.</holder>", result
end
diff --git a/test/sections_test.rb b/test/sections_test.rb
index 2687dde0..3db5347c 100644
--- a/test/sections_test.rb
+++ b/test/sections_test.rb
@@ -2312,7 +2312,7 @@ It was a dark and stormy night...
They couldn't believe their eyes when...
EOS
- output = render_string input, :header_footer => false
+ output = render_embedded_string input
assert_css '#preamble:root #toc', output, 1
assert_css '#preamble:root .paragraph + #toc', output, 1
end
@@ -2334,7 +2334,7 @@ It was a dark and stormy night...
They couldn't believe their eyes when...
EOS
- output = render_string input, :header_footer => false
+ output = render_embedded_string input
assert_css 'h1:root', output, 1
assert_css 'h1:root + #toc:root', output, 1
assert_css 'h1:root + #toc:root + #preamble:root', output, 1