spec/package_spec.rb in gepub-0.6.8.6 vs spec/package_spec.rb in gepub-0.6.8.7

- old
+ new

@@ -69,18 +69,18 @@ xml = Nokogiri::XML::Document.parse opf.opf_xml xml.root.name.should == 'package' xml.root.namespaces.size.should == 1 xml.root.namespaces['xmlns'].should == GEPUB::XMLUtil::OPF_NS xml.root['version'].should == '3.0' - xml.root['lang'].should == 'ja' + xml.root['xml:lang'].should == 'ja' # TODO: should check all elements end it 'should generate package with prefix attribute' do package = GEPUB::Package.new('OEBPS/package.opf') do |package| - package.set_main_id('http://example.jp', 'BookID', 'url') + package.set_primary_identifier('http://example.jp', 'BookID', 'url') package['xml:lang'] = 'ja' package.enable_rendition end xml = Nokogiri::XML::Document.parse package.opf_xml xml.root['prefix'].should == 'rendition: http://www.idpf.org/vocab/rendition/#' @@ -100,11 +100,11 @@ end it 'should generate opf2.0' do opf = GEPUB::Package.new('OEBPS/package.opf', { 'version' => '2.0'}) { |opf| - opf.set_main_id('http://example.jp', 'BookID', 'url') + opf.set_primary_identifier('http://example.jp', 'BookID', 'url') opf['xml:lang'] = 'ja' # metadata add: style 1 opf.metadata.add_title('EPUB3 Sample', nil, GEPUB::TITLE_TYPE::MAIN) { |title| @@ -131,9 +131,9 @@ xml = Nokogiri::XML::Document.parse opf.opf_xml xml.root.name.should == 'package' xml.root.namespaces.size.should == 1 xml.root.namespaces['xmlns'].should == GEPUB::XMLUtil::OPF_NS xml.root['version'].should == '2.0' - xml.root['lang'].should == 'ja' + xml.root['xml:lang'].should == 'ja' end end end