Sha256: 72dde5a8c7faf711582ca5e8eb875f1dc77a07af5864dd16f4f3d709421f157c

Contents?: true

Size: 1.53 KB

Versions: 6

Compression:

Stored size: 1.53 KB

Contents

require("../env");
require("../../d3");

var vows = require("vows"),
    assert = require("assert");

var suite = vows.describe("ns");

suite.addBatch({
  "prefix": {
    topic: function() {
      return d3.ns.prefix;
    },
    "svg is http://www.w3.org/2000/svg": function(prefix) {
      assert.equal(prefix.svg, "http://www.w3.org/2000/svg");
    },
    "xhtml is http://www.w3.org/1999/xhtml": function(prefix) {
      assert.equal(prefix.xhtml, "http://www.w3.org/1999/xhtml");
    },
    "xlink is http://www.w3.org/1999/xlink": function(prefix) {
      assert.equal(prefix.xlink, "http://www.w3.org/1999/xlink");
    },
    "xml is http://www.w3.org/XML/1998/namespace": function(prefix) {
      assert.equal(prefix.xml, "http://www.w3.org/XML/1998/namespace");
    },
    "xmlns is http://www.w3.org/2000/xmlns/": function(prefix) {
      assert.equal(prefix.xmlns, "http://www.w3.org/2000/xmlns/");
    }
  }
});

suite.addBatch({
  "qualify": {
    topic: function() {
      return d3.ns.qualify;
    },
    "local name returns name": function() {
      assert.equal(d3.ns.qualify("local"), "local");
    },
    "known qualified name returns space and local": function() {
      var name = d3.ns.qualify("svg:path");
      assert.equal(name.space, "http://www.w3.org/2000/svg");
      assert.equal(name.local, "path");
    },
    "unknown qualified name returns undefined and local": function() {
      var name = d3.ns.qualify("foo:bar");
      assert.isUndefined(name.space);
      assert.equal(name.local, "bar");
    }
  }
});

suite.export(module);

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bum-0.0.17 public/d3/test/core/ns-test.js
bum-0.0.16 public/d3/test/core/ns-test.js
bum-0.0.15 public/d3/test/core/ns-test.js
bum-0.0.14 public/d3/test/core/ns-test.js
bum-0.0.13 public/d3/test/core/ns-test.js
bum-0.0.12 public/d3/test/core/ns-test.js