summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Allen <dallen@redhat.com>2013-05-22 03:20:30 -0600
committerDan Allen <dallen@redhat.com>2013-05-22 03:20:30 -0600
commitdd5ae5afa6db95651eb67c19eaaeab4e368dc641 (patch)
tree28fded3344e8cde4ef866e34cbb39437865a14bb /test
parent23121b0f92b27086704f2d29efa25f478e2e1db7 (diff)
resolves #335 fix bad variable name, add test for it
Diffstat (limited to 'test')
-rw-r--r--test/document_test.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/document_test.rb b/test/document_test.rb
index 27d84259..943b9a71 100644
--- a/test/document_test.rb
+++ b/test/document_test.rb
@@ -404,6 +404,27 @@ text
end
end
+ test 'wip should render document to file when base dir is set' do
+ sample_input_path = fixture_path('sample.asciidoc')
+ sample_output_path = fixture_path('result.html')
+ fixture_dir = fixture_path('')
+ begin
+ Asciidoctor.render_file(sample_input_path, :to_file => 'result.html', :base_dir => fixture_dir)
+ assert File.exist?(sample_output_path)
+ output = File.read(sample_output_path)
+ assert !output.empty?
+ assert_xpath '/html', output, 1
+ assert_xpath '/html/head', output, 1
+ assert_xpath '/html/body', output, 1
+ assert_xpath '/html/head/title[text() = "Document Title"]', output, 1
+ assert_xpath '/html/body/*[@id="header"]/h1[text() = "Document Title"]', output, 1
+ rescue => e
+ flunk e.message
+ ensure
+ FileUtils::rm(sample_output_path, :force => true)
+ end
+ end
+
test 'in_place option must not be used with to_file option' do
sample_input_path = fixture_path('sample.asciidoc')
sample_output_path = fixture_path('result.html')