spec/package_spec.rb in gepub-0.6.8.9 vs spec/package_spec.rb in gepub-0.6.9.0
- old
+ new
@@ -92,14 +92,25 @@
package.rendition_layout = 'pre-paginated'
package.rendition_orientation = 'portlait'
package.rendition_spread = 'landscape'
end
xml = Nokogiri::XML::Document.parse package.opf_xml
+ xml.root['prefix'].should == 'rendition: http://www.idpf.org/vocab/rendition/#'
xml.at_xpath("//xmlns:meta[@property='rendition:layout']").content.should == 'pre-paginated'
xml.at_xpath("//xmlns:meta[@property='rendition:orientation']").content.should == 'portlait'
xml.at_xpath("//xmlns:meta[@property='rendition:spread']").content.should == 'landscape'
end
+ it 'should handle ibooks version' do
+ package = GEPUB::Package.new('OEBPS/package.opf') do
+ |package|
+ package.ibooks_version = '1.1.1'
+ end
+ xml = Nokogiri::XML::Document.parse package.opf_xml
+ xml.root['prefix'].should == 'ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/'
+ xml.at_xpath("//xmlns:meta[@property='ibooks:version']").content.should == '1.1.1'
+ end
+
it 'should generate opf2.0' do
opf = GEPUB::Package.new('OEBPS/package.opf', { 'version' => '2.0'}) {
|opf|
opf.set_primary_identifier('http://example.jp', 'BookID', 'url')
opf['xml:lang'] = 'ja'