Sha256: e2fba743698a33a506a8fc3f295d5f1f984e96763997e7c62b9544dccbc155d8

Contents?: true

Size: 1.52 KB

Versions: 2

Compression:

Stored size: 1.52 KB

Contents

# -*- coding: utf-8 -*-
# need to install 'epubcheck'.

require File.dirname(__FILE__) + '/spec_helper.rb'
require 'rubygems'
require 'xml/libxml'


describe GEPUB::Gepuber do
  it "should be initialized with empty conf" do
    gepuber = GEPUB::Gepuber.new({})
    gepuber.texts.should == ['[0-9]*.html']
    gepuber.resources.should == ['*.css',  'img/*']
    gepuber.title.should == ""
    gepuber.table_of_contents.should == {}
  end

  it "should read config hash" do
    conf = 
      {
      locale: 'ja',
      title: 'theTitle',
      author: 'theAuthor',
      publisher: 'thePublisher',
      date: '2011-03-11',
      identifier: 'http://skoji.jp/gepuber/2011-03-11.0.0',
      epubname: 'gepub_00',
      table_of_contents: {
        '1_.html' => '1st toc',
        '3_.html' => '3rd toc',
        '9_.html' => 'last toc'
      },
      coverimg: 'cover.gif',
      texts: [ '*.html' ],
      resources: ['*.css','*.gif']
    }

    gepuber = GEPUB::Gepuber.new(conf )
    gepuber.title.should == "theTitle"
    gepuber.locale.should == "ja"
    gepuber.author.should == "theAuthor"
    gepuber.publisher.should == "thePublisher"
    gepuber.date.should == "2011-03-11"
    gepuber.identifier.should == 'http://skoji.jp/gepuber/2011-03-11.0.0'
    gepuber.epubname.should == 'gepub_00'
    gepuber.coverimg.should == 'cover.gif'
    gepuber.table_of_contents.should == {  '1_.html' => '1st toc',  '3_.html' => '3rd toc',  '9_.html' => 'last toc'}
    gepuber.texts.should == ['*.html']
    gepuber.resources.should == ['*.css',  '*.gif']

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gepub-0.4.1 spec/gepuber_spec.rb
gepub-0.4.0 spec/gepuber_spec.rb