From 5d48a7383a809f96eb155a7a29b31baadcdf0880 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 21 May 2011 12:09:00 +0200 Subject: [PATCH] Tests: add compareGradientColors helper function. --- test/lib/helpers.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/lib/helpers.js b/test/lib/helpers.js index 7b4d5549..5a981ce2 100644 --- a/test/lib/helpers.js +++ b/test/lib/helpers.js @@ -88,6 +88,16 @@ function compareGrayColors(color1, color2, message) { (message || '') + ' gray'); } +function compareGradientColors(color1, color2) { + Base.each(['origin', 'destination', 'hilite'], function(key) { + equals(color1[key].toString(), color2[key].toString(), + 'color1[' + key + '].toString() == color2[' + key + '].toString()'); + }); + equals(function() { + return color1.gradient.equals(color2.gradient); + }, true); +} + function cloneAndCompare(item) { var copy = item.clone(); compareItems(item, copy);