From f0dc4d5ee03add261242743aa583c19d918f317c Mon Sep 17 00:00:00 2001 From: wout Date: Fri, 1 Aug 2014 20:40:49 +0200 Subject: Added SVG.Bare for creation of non-described elements --- spec/index.html | 2 +- spec/spec/bare.js | 40 ++++++++++++++++++++++++++++++++++++++++ spec/spec/symbol.js | 16 ---------------- 3 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 spec/spec/bare.js delete mode 100644 spec/spec/symbol.js (limited to 'spec') 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 @@ - + 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('These are some words.') + }) + }) + +}) \ 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 -- cgit v1.2.3