File: import.coffee

package info (click to toggle)
node-xml2js 0.4.23%2B~cs15.4.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,380 kB
  • sloc: xml: 117; javascript: 7; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 818 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
suite 'Edit:', ->
  test 'Import', ->
    test13imported = xml('test13imported', { headless: true })
      .ele('node', 'imported')

    eq(
      xml('test13', { headless: true })
        .importDocument(test13imported.doc())
        .end()
      '<test13><test13imported><node>imported</node></test13imported></test13>'
    )

    eq(
      xml('test13', { headless: true })
        .importXMLBuilder(test13imported.doc())
        .end()
      '<test13><test13imported><node>imported</node></test13imported></test13>'
    )

  test 'Import in to empty document', ->
    importedDoc = xml('imported', { headless: true })
      .ele('node', 'imported node')

    eq(
      doc({ headless: true })
        .importDocument(importedDoc.doc())
        .end()
      '<imported><node>imported node</node></imported>'
    )