From b5bc8c9811e674bdaa6afca45d09339a9e2c8ca8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 26 Mar 2015 15:25:34 +0800 Subject: [PATCH] spec: clipboard.readImage() --- spec/api-clipboard-spec.coffee | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/api-clipboard-spec.coffee b/spec/api-clipboard-spec.coffee index eecf61ca454..feadd15b0a6 100644 --- a/spec/api-clipboard-spec.coffee +++ b/spec/api-clipboard-spec.coffee @@ -1,7 +1,18 @@ assert = require 'assert' clipboard = require 'clipboard' +nativeImage = require 'native-image' +path = require 'path' describe 'clipboard module', -> + fixtures = path.resolve __dirname, 'fixtures' + + describe 'clipboard.readImage()', -> + it 'returns NativeImage intance', -> + p = path.join fixtures, 'assets', 'logo.png' + i = nativeImage.createFromPath p + clipboard.writeImage p + assert.equal clipboard.readImage().toDataUrl(), i.toDataUrl() + describe 'clipboard.readText()', -> it 'returns unicode string correctly', -> text = '千江有水千江月,万里无云万里天'