From c168777a82c9dd81af36cb7f7d4948c148403ea0 Mon Sep 17 00:00:00 2001 From: wout Date: Sat, 21 Jun 2014 22:30:49 +0200 Subject: Speccing adopter module --- spec/index.html | 17 +++++++++++++++++ spec/spec/adopter.js | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 spec/spec/adopter.js (limited to 'spec') diff --git a/spec/index.html b/spec/index.html index 2dd41b2..7932214 100755 --- a/spec/index.html +++ b/spec/index.html @@ -19,6 +19,22 @@ + + + + + + + + + + + + A + B + C + + @@ -30,6 +46,7 @@ + diff --git a/spec/spec/adopter.js b/spec/spec/adopter.js new file mode 100644 index 0000000..efdb806 --- /dev/null +++ b/spec/spec/adopter.js @@ -0,0 +1,21 @@ +describe('Adopter', function() { + var path + + beforeEach(function() { + path = SVG.get('lineAB') + }) + + it('adopts an exiting path element', function() { + expect(path instanceof SVG.Path).toBe(true) + }) + + it('modifies an adopted element', function() { + path.fill('#f06') + expect(path.node.getAttribute('fill')).toBe('#ff0066') + }) + + it('adopts a parent when parent() method is called', function() { + expect(path.parent() instanceof SVG.Doc).toBe(true) + }) + +}) \ No newline at end of file -- cgit v1.2.3