summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-08-01 20:40:49 +0200
committerwout <wout@impinc.co.uk>2014-08-01 20:40:49 +0200
commitf0dc4d5ee03add261242743aa583c19d918f317c (patch)
tree2d480aed288eb180e53c3c0fba8623029478db8b /spec
parentc2d1b2916b38d111d8672826c1219ab891567798 (diff)
downloadsvg.js-f0dc4d5ee03add261242743aa583c19d918f317c.tar.gz
svg.js-f0dc4d5ee03add261242743aa583c19d918f317c.zip
Added SVG.Bare for creation of non-described elements
Diffstat (limited to 'spec')
-rwxr-xr-xspec/index.html2
-rw-r--r--spec/spec/bare.js40
-rw-r--r--spec/spec/symbol.js16
3 files changed, 41 insertions, 17 deletions
diff --git a/spec/index.html b/spec/index.html
index 816f78e..21b3ba5 100755
--- a/spec/index.html
+++ b/spec/index.html
@@ -76,7 +76,7 @@
<script src="spec/gradient.js"></script>
<script src="spec/pattern.js"></script>
<script src="spec/use.js"></script>
-<script src="spec/symbol.js"></script>
+<script src="spec/bare.js"></script>
<script src="spec/mask.js"></script>
<script src="spec/clip.js"></script>
<script src="spec/color.js"></script>
diff --git a/spec/spec/bare.js b/spec/spec/bare.js
new file mode 100644
index 0000000..a27dbc3
--- /dev/null
+++ b/spec/spec/bare.js
@@ -0,0 +1,40 @@
+describe('Bare', function() {
+
+ describe('element()', function() {
+ var element
+
+ beforeEach(function() {
+ element = draw.element('rect')
+ })
+
+ it('creates an instance of SVG.Bare', function() {
+ expect(element instanceof SVG.Bare).toBeTruthy()
+ })
+ it('creates element in called parent', function() {
+ expect(element.parent()).toBe(draw)
+ })
+ })
+
+ describe('symbol()', function() {
+ var symbol
+
+ beforeEach(function() {
+ symbol = draw.symbol()
+ })
+
+ it('creates an instance of SVG.Bare', function() {
+ expect(symbol instanceof SVG.Bare).toBeTruthy()
+ })
+ it('creates symbol in defs', function() {
+ expect(symbol.parent() instanceof SVG.Defs).toBeTruthy()
+ })
+ })
+
+ describe('words()', function() {
+ it('inserts plain text in a node', function() {
+ var element = draw.element('title').words('These are some words.').id(null)
+ expect(element.svg()).toBe('<title>These are some words.</title>')
+ })
+ })
+
+}) \ No newline at end of file
diff --git a/spec/spec/symbol.js b/spec/spec/symbol.js
deleted file mode 100644
index a8e7b04..0000000
--- a/spec/spec/symbol.js
+++ /dev/null
@@ -1,16 +0,0 @@
-describe('Symbol', function() {
- var symbol
-
- beforeEach(function() {
- symbol = draw.symbol()
- })
-
- it('creates an instance of SVG.Symbol', function() {
- expect(symbol instanceof SVG.Symbol).toBeTruthy()
- })
-
- it('creates symbol in defs', function() {
- expect(symbol.parent() instanceof SVG.Defs).toBeTruthy()
- })
-
-}) \ No newline at end of file