File: xmldeclaration.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 (25 lines) | stat: -rw-r--r-- 767 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
suite 'XML Declaration:', ->
  test 'From create() without arguments', ->
    eq(
      xml('test').end()
      '<?xml version="1.0"?><test/>'
    )

  test 'From create() with arguments', ->
    eq(
      xml('test', { version: '1.1', encoding: 'UTF-8', standalone: true }).end()
      '<?xml version="1.1" encoding="UTF-8" standalone="yes"?><test/>'
    )
    
  test 'From dec() without arguments', ->
    eq(
      xml('test', { headless: true }).dec().ele('node').end()
      '<?xml version="1.0"?><test><node/></test>'
    )

  test 'From dec() with arguments', ->
    eq(
      xml('test').dec({ version: '1.1', encoding: 'UTF-8', standalone: true }).ele('node').end()
      '<?xml version="1.1" encoding="UTF-8" standalone="yes"?><test><node/></test>'
    )