From b20e972bec52781de806fb050e72d44b729c6541 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Sat, 31 Jan 2015 15:22:05 +0100 Subject: few methods moved to utils --- test/abi.filters.js | 49 ------------------------------------------------- test/utils.filters.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 test/abi.filters.js create mode 100644 test/utils.filters.js (limited to 'test') diff --git a/test/abi.filters.js b/test/abi.filters.js deleted file mode 100644 index 42385fd2a..000000000 --- a/test/abi.filters.js +++ /dev/null @@ -1,49 +0,0 @@ -var assert = require('assert'); -var abi = require('../lib/abi.js'); - -describe('abi', function() { - it('should filter functions and events from input array properly', function () { - - // given - var description = [{ - "name": "test", - "type": "function", - "inputs": [{ - "name": "a", - "type": "uint256" - } - ], - "outputs": [ - { - "name": "d", - "type": "uint256" - } - ], - }, { - "name": "test2", - "type": "event", - "inputs": [{ - "name": "a", - "type": "uint256" - } - ], - "outputs": [ - { - "name": "d", - "type": "uint256" - } - ] - }]; - - // when - var events = abi.filterEvents(description); - var functions = abi.filterFunctions(description); - - // then - assert.equal(events.length, 1); - assert.equal(events[0].name, 'test2'); - assert.equal(functions.length, 1); - assert.equal(functions[0].name, 'test'); - - }); -}); diff --git a/test/utils.filters.js b/test/utils.filters.js new file mode 100644 index 000000000..f2d2788b0 --- /dev/null +++ b/test/utils.filters.js @@ -0,0 +1,49 @@ +var assert = require('assert'); +var utils = require('../lib/utils.js'); + +describe('utils', function() { + it('should filter functions and events from input array properly', function () { + + // given + var description = [{ + "name": "test", + "type": "function", + "inputs": [{ + "name": "a", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "d", + "type": "uint256" + } + ], + }, { + "name": "test2", + "type": "event", + "inputs": [{ + "name": "a", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "d", + "type": "uint256" + } + ] + }]; + + // when + var events = utils.filterEvents(description); + var functions = utils.filterFunctions(description); + + // then + assert.equal(events.length, 1); + assert.equal(events[0].name, 'test2'); + assert.equal(functions.length, 1); + assert.equal(functions[0].name, 'test'); + + }); +}); -- cgit v1.2.3