Skip to content

Commit

Permalink
added spec test for generating document header from DocBook 5 content
Browse files Browse the repository at this point in the history
  • Loading branch information
fbolton authored and mojavelinux committed Oct 12, 2023
1 parent fed0079 commit a0e0c75
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion spec/lib/docbookrx/docbookrx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'spec_helper'

describe 'Conversion' do
it 'should create a document header with title, author and attributes' do
it 'should create a document header with title, author and attributes from DocBook 4.5 content' do
input = <<-EOS
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
Expand All @@ -23,6 +23,48 @@

expected = <<-EOS.rstrip
= Document Title
Doc Writer <[email protected]>
:doctype: book
:sectnums:
:toc: left
:icons: font
:experimental:
== First Section
content
EOS

output = Docbookrx.convert input

expect(output).to eq(expected)
end

it 'should create a document header with title, author and attributes from DocBook 5 content' do
input = <<-EOS
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook">
<title>Document Title</title>
<info>
<author>
<personname>
<firstname>Doc</firstname>
<surname>Writer</surname>
</personname>
<email>[email protected]</email>
</author>
</info>
<section>
<title>First Section</title>
<para>content</para>
</section>
</book>
EOS

expected = <<-EOS.rstrip
= Document Title
Doc Writer <[email protected]>
:doctype: book
:sectnums:
Expand Down

0 comments on commit a0e0c75

Please sign in to comment.