From b360122b35cfeeaa93da810b862ee0951484a8db Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 6 Nov 2014 21:26:54 +0800 Subject: [PATCH] Add spec for #634 --- spec/node-spec.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/node-spec.coffee b/spec/node-spec.coffee index 46dcd381aed5..3a2013839f53 100644 --- a/spec/node-spec.coffee +++ b/spec/node-spec.coffee @@ -108,3 +108,11 @@ describe 'node feature', -> client.on 'error', (error) -> assert.equal error.code, 'ECONNREFUSED' done() + + describe 'Buffer', -> + it 'can be created from WebKit external string', -> + p = document.createElement 'p' + p.innerText = '闲云潭影日悠悠,物换星移几度秋' + b = new Buffer(p.innerText) + assert.equal b.toString(), '闲云潭影日悠悠,物换星移几度秋' + assert.equal Buffer.byteLength(p.innerText), 45