Sha256: 5c0bae9c3679eaa0e375e2fc7aa61bb8d154ab083f11c36e7526fe2bb4a05a39

Contents?: true

Size: 700 Bytes

Versions: 3

Compression:

Stored size: 700 Bytes

Contents

# -*- coding: utf-8 -*-
require File.expand_path 'helper', File.dirname(__FILE__)
require 'epub/parser/ocf'

class TestParserOCF < Test::Unit::TestCase
  def setup
    file = 'test/fixtures/book.epub'
    @zip = Zip::Archive.open(file)
    @parser = EPUB::Parser::OCF.new(@zip)
  end

  def teardown
    @zip.close
  end

  def test_parsed_container_has_one_rootfile
    assert_equal 1, @parser.parse_container.rootfiles.length
  end

  def test_parse_container_can_find_primary_rootfile
    container = @parser.parse_container

    assert_equal 'OPS/ルートファイル.opf', container.rootfile.full_path
  end

  def test_parse
    assert_nothing_raised do
      @parser.parse
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
epub-parser-0.0.9.4 test/test_parser_ocf.rb
epub-parser-0.0.9.3 test/test_parser_ocf.rb
epub-parser-0.0.9.2 test/test_parser_ocf.rb