|
15 | 15 |
|
16 | 16 | <!-- Global params for testing -->
|
17 | 17 | <x:param name="metadata.unique-identifier.id" select="'pub-identifier'"/>
|
| 18 | + <x:param name="metadata.unique-identifier"/> <!-- Leave blank globally --> |
18 | 19 | <x:param name="metadata.ibooks-specified-fonts" select="1"/>
|
19 | 20 | <x:param name="generate.cover.html" select="1"/>
|
20 | 21 |
|
@@ -249,7 +250,7 @@ UbuntuMono-Regular.otf
|
249 | 250 |
|
250 | 251 | <x:scenario label="When generating OPF metadata for a book (with all metadata supplied)">
|
251 | 252 | <x:call template="opf.metadata">
|
252 |
| - <x:param name="metadata.unique-identifier" select="'9780000000000'"/> |
| 253 | + <x:param name="computed.identifier" select="'9780000000000'"/> |
253 | 254 | <x:param name="metadata.ibooks-specified-fonts" select="1"/>
|
254 | 255 | <x:param name="metadata.title" select="'Understanding Computation'"/>
|
255 | 256 | <x:param name="metadata.language" select="'fr'"/>
|
@@ -295,46 +296,6 @@ UbuntuMono-Regular.otf
|
295 | 296 | <x:expect label="Cover metadata should be generated" test="exists(/opf:metadata/opf:meta[@name='cover' and @content='bookcoverimage'])"/>
|
296 | 297 | <x:expect label="iBooks metadata should be generated if specified" test="exists(/opf:metadata/opf:meta[@property='ibooks:specified-fonts' and . = 'true'])"/>
|
297 | 298 |
|
298 |
| - <x:scenario label="When generating OPF metadata for book without any metadata supplied or a cover"> |
299 |
| - <x:call> |
300 |
| - <x:param name="metadata.unique-identifier"/> |
301 |
| - <x:param name="metadata.ibooks-specified-fonts"/> |
302 |
| - <x:param name="metadata.title"/> |
303 |
| - <x:param name="metadata.language"/> |
304 |
| - <x:param name="metadata.modified"/> |
305 |
| - <x:param name="metadata.rights"/> |
306 |
| - <x:param name="metadata.publisher"/> |
307 |
| - <x:param name="metadata.subject"/> |
308 |
| - <x:param name="metadata.date"/> |
309 |
| - <x:param name="metadata.description"/> |
310 |
| - <x:param name="metadata.contributors"/> |
311 |
| - <x:param name="metadata.creators"/> |
312 |
| - <x:param name="generate.cover.html"/> |
313 |
| - </x:call> |
314 |
| - <x:expect label="Default value should be subbed in for book identifier to ensure EPUB validity" test="exists(/opf:metadata/dc:identifier[contains(., 'randomid')]) and |
315 |
| - exists(/opf:metadata/opf:meta[@property = 'dcterms:identifier' and contains(., 'randomid')])"/> |
316 |
| - <x:expect label="Default value should be subbed in for book title to ensure EPUB validity" test="exists(/opf:metadata/dc:title[. = 'Untitled Book']) and |
317 |
| - exists(/opf:metadata/opf:meta[@property = 'dcterms:title' and . = 'Untitled Book'])"/> |
318 |
| - <x:expect label="Default value should be subbed in for book language to ensure EPUB validity" test="exists(/opf:metadata/dc:language[. = 'en']) and |
319 |
| - exists(/opf:metadata/opf:meta[@property = 'dcterms:language' and . = 'en'])"/> |
320 |
| - <x:expect label="Default value should be subbed in for book modification date to ensure EPUB validity" test="exists(/opf:metadata/opf:meta[@property = 'dcterms:modified' and . = '2014-01-01'])"/> |
321 |
| - <x:expect label="Rights information *should not* be generated" test="not(exists(/opf:metadata/dc:rights)) and |
322 |
| - not(exists(/opf:metadata/opf:meta[@property = 'dcterms:rightsHolder']))"/> |
323 |
| - <x:expect label="Publisher information *should not* be generated" test="not(exists(/opf:metadata/dc:publisher)) and |
324 |
| - not(exists(/opf:metadata/opf:meta[@property = 'dcterms:publisher']))"/> |
325 |
| - <x:expect label="Subject (category) information *should not* be generated" test="not(exists(/opf:metadata/dc:subject)) and |
326 |
| - not(exists(/opf:metadata/opf:meta[@property = 'dcterms:subject']))"/> |
327 |
| - <x:expect label="Publication date information *should not* be generated" test="not(exists(/opf:metadata/dc:date)) and |
328 |
| - not(exists(/opf:metadata/opf:meta[@property = 'dcterms:date']))"/> |
329 |
| - <x:expect label="Description information *should not* be generated" test="not(exists(/opf:metadata/dc:description)) and |
330 |
| - not(exists(/opf:metadata/opf:meta[@property = 'dcterms:description']))"/> |
331 |
| - <x:expect label="Contributor information *should not* be generated" test="not(exists(/opf:metadata/dc:contributor)) and |
332 |
| - not(exists(/opf:metadata/opf:meta[@property = 'dcterms:contributor']))"/> |
333 |
| - <x:expect label="Creator information *should not* be generated" test="not(exists(/opf:metadata/dc:creator)) and |
334 |
| - not(exists(/opf:metadata/opf:meta[@property = 'dcterms:creator']))"/> |
335 |
| - <x:expect label="Cover metadata *should not* be generated if book does not have a cover" test="not(exists(/opf:metadata/opf:meta[@name = 'cover']))"/> |
336 |
| - <x:expect label="iBooks metadata *should not* be generated if *not* specified" test="not(exists(/opf:metadata/opf:meta[@property='ibooks:specified-fonts']))"/> |
337 |
| - </x:scenario> |
338 | 299 | <x:scenario label="When generating OPF metadata for a book with two authors specified">
|
339 | 300 | <x:call>
|
340 | 301 | <x:param name="metadata.creators">
|
@@ -385,6 +346,46 @@ UbuntuMono-Regular.otf
|
385 | 346 |
|
386 | 347 | </x:scenario>
|
387 | 348 |
|
| 349 | + <x:scenario label="When generating OPF metadata for book without any metadata supplied or a cover"> |
| 350 | + <x:call template="opf.metadata"> |
| 351 | + <x:param name="metadata.ibooks-specified-fonts"/> |
| 352 | + <x:param name="metadata.title"/> |
| 353 | + <x:param name="metadata.language"/> |
| 354 | + <x:param name="metadata.modified"/> |
| 355 | + <x:param name="metadata.rights"/> |
| 356 | + <x:param name="metadata.publisher"/> |
| 357 | + <x:param name="metadata.subject"/> |
| 358 | + <x:param name="metadata.date"/> |
| 359 | + <x:param name="metadata.description"/> |
| 360 | + <x:param name="metadata.contributors"/> |
| 361 | + <x:param name="metadata.creators"/> |
| 362 | + <x:param name="generate.cover.html"/> |
| 363 | + </x:call> |
| 364 | + <x:expect label="Default value should be subbed in for book identifier to ensure EPUB validity" test="exists(/opf:metadata/dc:identifier[contains(., 'randomid')]) and |
| 365 | + exists(/opf:metadata/opf:meta[@property = 'dcterms:identifier' and contains(., 'randomid')])"/> |
| 366 | + <x:expect label="Default value should be subbed in for book title to ensure EPUB validity" test="exists(/opf:metadata/dc:title[. = 'Untitled Book']) and |
| 367 | + exists(/opf:metadata/opf:meta[@property = 'dcterms:title' and . = 'Untitled Book'])"/> |
| 368 | + <x:expect label="Default value should be subbed in for book language to ensure EPUB validity" test="exists(/opf:metadata/dc:language[. = 'en']) and |
| 369 | + exists(/opf:metadata/opf:meta[@property = 'dcterms:language' and . = 'en'])"/> |
| 370 | + <x:expect label="Default value should be subbed in for book modification date to ensure EPUB validity" test="exists(/opf:metadata/opf:meta[@property = 'dcterms:modified' and . = '2014-01-01'])"/> |
| 371 | + <x:expect label="Rights information *should not* be generated" test="not(exists(/opf:metadata/dc:rights)) and |
| 372 | + not(exists(/opf:metadata/opf:meta[@property = 'dcterms:rightsHolder']))"/> |
| 373 | + <x:expect label="Publisher information *should not* be generated" test="not(exists(/opf:metadata/dc:publisher)) and |
| 374 | + not(exists(/opf:metadata/opf:meta[@property = 'dcterms:publisher']))"/> |
| 375 | + <x:expect label="Subject (category) information *should not* be generated" test="not(exists(/opf:metadata/dc:subject)) and |
| 376 | + not(exists(/opf:metadata/opf:meta[@property = 'dcterms:subject']))"/> |
| 377 | + <x:expect label="Publication date information *should not* be generated" test="not(exists(/opf:metadata/dc:date)) and |
| 378 | + not(exists(/opf:metadata/opf:meta[@property = 'dcterms:date']))"/> |
| 379 | + <x:expect label="Description information *should not* be generated" test="not(exists(/opf:metadata/dc:description)) and |
| 380 | + not(exists(/opf:metadata/opf:meta[@property = 'dcterms:description']))"/> |
| 381 | + <x:expect label="Contributor information *should not* be generated" test="not(exists(/opf:metadata/dc:contributor)) and |
| 382 | + not(exists(/opf:metadata/opf:meta[@property = 'dcterms:contributor']))"/> |
| 383 | + <x:expect label="Creator information *should not* be generated" test="not(exists(/opf:metadata/dc:creator)) and |
| 384 | + not(exists(/opf:metadata/opf:meta[@property = 'dcterms:creator']))"/> |
| 385 | + <x:expect label="Cover metadata *should not* be generated if book does not have a cover" test="not(exists(/opf:metadata/opf:meta[@name = 'cover']))"/> |
| 386 | + <x:expect label="iBooks metadata *should not* be generated if *not* specified" test="not(exists(/opf:metadata/opf:meta[@property='ibooks:specified-fonts']))"/> |
| 387 | + </x:scenario> |
| 388 | + |
388 | 389 | <x:scenario label="When generate-spine is called">
|
389 | 390 | <x:call template="generate-spine">
|
390 | 391 | <x:param name="generate.ncx.toc" select="1"/>
|
|
0 commit comments