Sha256: bae3cfe3e7ae812ea578794e389089db53467277a4fecae328838c38234bf317

Contents?: true

Size: 752 Bytes

Versions: 6

Compression:

Stored size: 752 Bytes

Contents

require 'minitest/autorun'
require 'epubber'

class EpubberTest < Minitest::Test
  def test_dsl
    result = Epubber.generate do |b|
      b.title 'My First EPUB book'
      b.author 'Ramirez, Federico'

      b.introduction do |i|
        i.content "<p>This is the introduction, and it's optional. What is this book about?</p>"
      end

      b.chapter do |c|
        c.title 'Chapter 1'
        c.content '<p>This is some content!</p>'
      end

      b.chapter do |c|
        c.title 'Chapter 2'
        c.content '<p>Some more content this is.</p>'
      end

      b.endnotes do |e|
        e.content '<p>This was a fun book. Thanks for reading!</p>'
      end
    end

    assert_equal '/tmp/epubber/My First EPUB book.epub', result
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
epubber-0.1.5 test/test_epubber.rb
epubber-0.1.4 test/test_epubber.rb
epubber-0.1.3 test/test_epubber.rb
epubber-0.1.2 test/test_epubber.rb
epubber-0.1.1 test/test_epubber.rb
epubber-0.1.0 test/test_epubber.rb