sass-planifolia

Vanilla Sass helper functions
git clone https://git.ce9e.org/sass-planifolia.git

commit
3c687371a6afc88a7feb4ef56a2cf96b415e36e4
parent
d8e314e32172af0c21cdb5db70bb657b3507fffb
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-04-11 07:45
drop unmaintained sassaby

Diffstat

M package.json 1 -
M test/color.js 226 ++++++++++++++++++++++++++++++-------------------------------
M test/contrast.js 106 +++++++++++++++++++++++++++++--------------------------------
M test/grid.js 53 +++++++++++++++++++++++++----------------------------
M test/math.js 147 ++++++++++++++++++++++++++++++-------------------------------
M test/shared.js 26 +++++++++++++++++++++++---

6 files changed, 280 insertions, 279 deletions


diff --git a/package.json b/package.json

@@ -7,7 +7,6 @@
    7     7   "devDependencies": {
    8     8     "mocha": "^3.5.3",
    9     9     "node-sass": "^4.8.3",
   10    -1     "sassaby": "^2.1.1",
   11    10     "sassdoc": "^2.6.0"
   12    11   },
   13    12   "scripts": {

diff --git a/test/color.js b/test/color.js

@@ -1,157 +1,151 @@
    1    -1 var path = require('path');
    2    -1 var Sassaby = require('sassaby');
   -1     1 var assert = require('assert');
    3     2 var shared = require('./shared');
    4     3 
    5     4 describe('color', function() {
    6    -1   var file = path.resolve(__dirname, '../sass/color.scss');
    7    -1   var sassaby = new Sassaby(file, {
    8    -1     dependencies: [
    9    -1       path.resolve(__dirname, '../sass/math.scss')
   10    -1     ]
   11    -1   });
   -1     5   var renderer = new shared.Renderer('@import "math"; @import "color";');
   12     6 
   13     7   describe('lab', function() {
   14     8     describe('lch', function() {
   15     9       it('white', function() {
   16    -1         sassaby.func('lch').calledWithArgs('100', '0', '0rad').equals('white');
   -1    10         assert.equal(renderer.value('lch(100, 0, 0rad)'), 'white')
   17    11       });
   18    12       it('black', function() {
   19    -1         sassaby.func('lch').calledWithArgs('0', '0', '0rad').equals('black');
   -1    13         assert.equal(renderer.value('lch(0, 0, 0rad)'), 'black')
   20    14       });
   21    15       it('red (rad)', function() {
   22    -1         sassaby.func('lch').calledWithArgs('53.23288', '104.57421', '0.69818rad').equals('red');
   -1    16         assert.equal(renderer.value('lch(53.23288, 104.57421, 0.69818rad)'), 'red')
   23    17       });
   24    18       it('red (deg)', function() {
   25    -1         sassaby.func('lch').calledWithArgs('53.23288', '104.57421', '40deg').equals('red');
   -1    19         assert.equal(renderer.value('lch(53.23288, 104.57421, 40deg)'), 'red')
   26    20       });
   27    21       it('red (unitless)', function() {
   28    -1         sassaby.func('lch').calledWithArgs('53.23288', '104.57421', '40').equals('red');
   -1    22         assert.equal(renderer.value('lch(53.23288, 104.57421, 40)'), 'red')
   29    23       });
   30    24       it('blue', function() {
   31    -1         sassaby.func('lch').calledWithArgs('32.30259', '133.80605', '-0.93744rad').equals('blue');
   -1    25         assert.equal(renderer.value('lch(32.30259, 133.80605, -0.93744rad)'), 'blue')
   32    26       });
   33    27     });
   34    28 
   35    29     describe('pf-lightness', function() {
   36    30       it('white', function() {
   37    -1         shared.similar(sassaby.func('pf-lightness').calledWithArgs('white'), 100);
   -1    31         shared.similar(renderer.value('pf-lightness(white)'), 100);
   38    32       });
   39    33       it('black', function() {
   40    -1         shared.similar(sassaby.func('pf-lightness').calledWithArgs('black'), 0);
   -1    34         shared.similar(renderer.value('pf-lightness(black)'), 0);
   41    35       });
   42    36       it('red', function() {
   43    -1         shared.similar(sassaby.func('pf-lightness').calledWithArgs('red'), 53.23288);
   -1    37         shared.similar(renderer.value('pf-lightness(red)'), 53.23288);
   44    38       });
   45    39       it('blue', function() {
   46    -1         shared.similar(sassaby.func('pf-lightness').calledWithArgs('blue'), 32.30259);
   -1    40         shared.similar(renderer.value('pf-lightness(blue)'), 32.30259);
   47    41       });
   48    42     });
   49    43 
   50    44     describe('pf-chroma', function() {
   51    45       it('white', function() {
   52    -1         shared.similar(sassaby.func('pf-chroma').calledWithArgs('white'), 0, 0.0001);
   -1    46         shared.similar(renderer.value('pf-chroma(white)'), 0, 0.0001);
   53    47       });
   54    48       it('black', function() {
   55    -1         shared.similar(sassaby.func('pf-chroma').calledWithArgs('black'), 0);
   -1    49         shared.similar(renderer.value('pf-chroma(black)'), 0);
   56    50       });
   57    51       it('red', function() {
   58    -1         shared.similar(sassaby.func('pf-chroma').calledWithArgs('red'), 104.57421);
   -1    52         shared.similar(renderer.value('pf-chroma(red)'), 104.57421);
   59    53       });
   60    54       it('blue', function() {
   61    -1         shared.similar(sassaby.func('pf-chroma').calledWithArgs('blue'), 133.80605);
   -1    55         shared.similar(renderer.value('pf-chroma(blue)'), 133.80605);
   62    56       });
   63    57     });
   64    58 
   65    59     describe('pf-hue', function() {
   66    60       it('white', function() {
   67    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('white'), 0);
   -1    61         shared.similar(renderer.value('pf-hue(white)'), 0);
   68    62       });
   69    63       it('black', function() {
   70    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('black'), 0);
   -1    64         shared.similar(renderer.value('pf-hue(black)'), 0);
   71    65       });
   72    66       it('red', function() {
   73    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('red'), 40.0027);
   -1    67         shared.similar(renderer.value('pf-hue(red)'), 40.0027);
   74    68       });
   75    69       it('yellow', function() {
   76    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('yellow'), 102.85403);
   -1    70         shared.similar(renderer.value('pf-hue(yellow)'), 102.85403);
   77    71       });
   78    72       it('green', function() {
   79    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('green'), 136.0155);
   -1    73         shared.similar(renderer.value('pf-hue(green)'), 136.0155);
   80    74       });
   81    75       it('blue', function() {
   82    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('blue'), -53.71132);
   -1    76         shared.similar(renderer.value('pf-hue(blue)'), -53.71132);
   83    77       });
   84    78     });
   85    79 
   86    80     describe('pf-complement', function() {
   87    81       it('white', function() {
   88    -1         sassaby.func('pf-complement').calledWithArgs('white').equals('white');
   -1    82         assert.equal(renderer.value('pf-complement(white)'), 'white')
   89    83       });
   90    84       it('red', function() {
   91    -1         sassaby.func('pf-complement').calledWithArgs('red').equals('#008ca1');
   -1    85         assert.equal(renderer.value('pf-complement(red)'), '#008ca1')
   92    86       });
   93    87       it('yellow', function() {
   94    -1         sassaby.func('pf-complement').calledWithArgs('yellow').equals('#f5f6ff');
   -1    88         assert.equal(renderer.value('pf-complement(yellow)'), '#f5f6ff')
   95    89       });
   96    90     });
   97    91 
   98    92     describe('pf-color-distance', function() {
   99    93       it('d(white, white) = 0', function() {
  100    -1         sassaby.func('pf-color-distance').calledWithArgs('white', 'white').equals(0);
   -1    94         assert.equal(renderer.value('pf-color-distance(white, white)'), 0)
  101    95       });
  102    96       it('d(red, red) = 0', function() {
  103    -1         sassaby.func('pf-color-distance').calledWithArgs('red', 'red').equals(0);
   -1    97         assert.equal(renderer.value('pf-color-distance(red, red)'), 0)
  104    98       });
  105    99       it('d(white, black) ~= 100', function() {
  106    -1         shared.similar(sassaby.func('pf-color-distance').calledWithArgs('white', 'black'), 100);
   -1   100         shared.similar(renderer.value('pf-color-distance(white, black)'), 100);
  107   101       });
  108   102       it('d(white, red)', function() {
  109    -1         shared.similar(sassaby.func('pf-color-distance').calledWithArgs('white', 'red'), 114.55535);
   -1   103         shared.similar(renderer.value('pf-color-distance(white, red)'), 114.55535);
  110   104       });
  111   105       it('d(red, blue)', function() {
  112    -1         shared.similar(sassaby.func('pf-color-distance').calledWithArgs('red', 'blue'), 176.32554);
   -1   106         shared.similar(renderer.value('pf-color-distance(red, blue)'), 176.32554);
  113   107       });
  114   108       it('d(blue, red)', function() {
  115    -1         shared.similar(sassaby.func('pf-color-distance').calledWithArgs('blue', 'red'), 176.32554);
   -1   109         shared.similar(renderer.value('pf-color-distance(blue, red)'), 176.32554);
  116   110       });
  117   111     });
  118   112 
  119   113     describe('pf-mix', function() {
  120   114       it('white, white', function() {
  121    -1         sassaby.func('pf-mix').calledWithArgs('white', 'white').equals('white');
   -1   115         assert.equal(renderer.value('pf-mix(white, white)'), 'white')
  122   116       });
  123   117       it('black, white', function() {
  124    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white').equals('#777');
   -1   118         assert.equal(renderer.value('pf-mix(black, white)'), '#777777')
  125   119       });
  126   120       it('black, white, 0%', function() {
  127    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '0%').equals('white');
   -1   121         assert.equal(renderer.value('pf-mix(black, white, 0%)'), 'white')
  128   122       });
  129   123       it('black, white, 100%', function() {
  130    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '100%').equals('black');
   -1   124         assert.equal(renderer.value('pf-mix(black, white, 100%)'), 'black')
  131   125       });
  132   126       it('black, white, 20%', function() {
  133    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '20%').equals('#c6c6c6');
   -1   127         assert.equal(renderer.value('pf-mix(black, white, 20%)'), '#c6c6c6')
  134   128       });
  135    -1       it('black, white, .2', function() {
  136    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '.2').equals('#c6c6c6');
   -1   129       it('black, white, 0.2', function() {
   -1   130         assert.equal(renderer.value('pf-mix(black, white, 0.2)'), '#c6c6c6')
  137   131       });
  138   132       it('blue, red', function() {
  139    -1         sassaby.func('pf-mix').calledWithArgs('blue', 'red').equals('#c20081');
   -1   133         assert.equal(renderer.value('pf-mix(blue, red)'), '#c20081')
  140   134       });
  141   135       it('blue, red, 20%', function() {
  142    -1         sassaby.func('pf-mix').calledWithArgs('blue', 'red', '20%').equals('#e70051');
   -1   136         assert.equal(renderer.value('pf-mix(blue, red, 20%)'), '#e70051')
  143   137       });
  144   138       it('green, red', function() {
  145    -1         sassaby.func('pf-mix').calledWithArgs('green', 'red').equals('#9d6e00');
   -1   139         assert.equal(renderer.value('pf-mix(green, red)'), '#9d6e00')
  146   140       });
  147   141       it('yellow, blue', function() {
  148    -1         sassaby.func('pf-mix').calledWithArgs('yellow', 'blue').equals('#ff6b89');
   -1   142         assert.equal(renderer.value('pf-mix(yellow, blue)'), '#ff6b89')
  149   143       });
  150   144       it('green, blue', function() {
  151    -1         sassaby.func('pf-mix').calledWithArgs('green', 'blue').equals('#006487');
   -1   145         assert.equal(renderer.value('pf-mix(green, blue)'), '#006487')
  152   146       });
  153   147       it('white, blue', function() {
  154    -1         sassaby.func('pf-mix').calledWithArgs('white', 'blue').equals('#b38cff');
   -1   148         assert.equal(renderer.value('pf-mix(white, blue)'), '#b38cff')
  155   149       });
  156   150     });
  157   151   });
@@ -159,124 +153,124 @@ describe('color', function() {
  159   153   describe('luv', function() {
  160   154     describe('lch', function() {
  161   155       it('white', function() {
  162    -1         sassaby.func('lch').calledWithArgs('100', '0', '0rad', 'luv').equals('white');
   -1   156         assert.equal(renderer.value('lch(100, 0, 0rad, "luv")'), 'white')
  163   157       });
  164   158       it('black', function() {
  165    -1         sassaby.func('lch').calledWithArgs('0', '0', '0rad', 'luv').equals('black');
   -1   159         assert.equal(renderer.value('lch(0, 0, 0rad, "luv")'), 'black')
  166   160       });
  167   161       it('red (rad)', function() {
  168    -1         sassaby.func('lch').calledWithArgs('53.23288', '179.07872', '0.21245rad', 'luv').equals('red');
   -1   162         assert.equal(renderer.value('lch(53.23288, 179.07872, 0.21245rad, "luv")'), 'red')
  169   163       });
  170   164       it('red (deg)', function() {
  171    -1         sassaby.func('lch').calledWithArgs('53.23288', '179.07872', '12.1725deg', 'luv').equals('red');
   -1   165         assert.equal(renderer.value('lch(53.23288, 179.07872, 12.1725deg, "luv")'), 'red')
  172   166       });
  173   167       it('red (unitless)', function() {
  174    -1         sassaby.func('lch').calledWithArgs('53.23288', '179.07872', '12.1725', 'luv').equals('red');
   -1   168         assert.equal(renderer.value('lch(53.23288, 179.07872, 12.1725, "luv")'), 'red')
  175   169       });
  176   170       it('blue', function() {
  177    -1         sassaby.func('lch').calledWithArgs('32.30259', '130.69138', '-1.64278rad', 'luv').equals('blue');
   -1   171         assert.equal(renderer.value('lch(32.30259, 130.69138, -1.64278rad, "luv")'), 'blue')
  178   172       });
  179   173     });
  180   174 
  181   175     describe('pf-lightness', function() {
  182   176       it('white', function() {
  183    -1         shared.similar(sassaby.func('pf-lightness').calledWithArgs('white', 'luv'), 100);
   -1   177         shared.similar(renderer.value('pf-lightness(white, "luv")'), 100);
  184   178       });
  185   179       it('black', function() {
  186    -1         shared.similar(sassaby.func('pf-lightness').calledWithArgs('black', 'luv'), 0);
   -1   180         shared.similar(renderer.value('pf-lightness(black, "luv")'), 0);
  187   181       });
  188   182       it('red', function() {
  189    -1         shared.similar(sassaby.func('pf-lightness').calledWithArgs('red', 'luv'), 53.23288);
   -1   183         shared.similar(renderer.value('pf-lightness(red, "luv")'), 53.23288);
  190   184       });
  191   185       it('blue', function() {
  192    -1         shared.similar(sassaby.func('pf-lightness').calledWithArgs('blue', 'luv'), 32.30259);
   -1   186         shared.similar(renderer.value('pf-lightness(blue, "luv")'), 32.30259);
  193   187       });
  194   188     });
  195   189 
  196   190     describe('pf-chroma', function() {
  197   191       it('white', function() {
  198    -1         shared.similar(sassaby.func('pf-chroma').calledWithArgs('white', 'luv'), 0, 0.0001);
   -1   192         shared.similar(renderer.value('pf-chroma(white, "luv")'), 0, 0.0001);
  199   193       });
  200   194       it('black', function() {
  201    -1         shared.similar(sassaby.func('pf-chroma').calledWithArgs('black', 'luv'), 0);
   -1   195         shared.similar(renderer.value('pf-chroma(black, "luv")'), 0);
  202   196       });
  203   197       it('red', function() {
  204    -1         shared.similar(sassaby.func('pf-chroma').calledWithArgs('red', 'luv'), 179.07872);
   -1   198         shared.similar(renderer.value('pf-chroma(red, "luv")'), 179.07872);
  205   199       });
  206   200       it('blue', function() {
  207    -1         shared.similar(sassaby.func('pf-chroma').calledWithArgs('blue', 'luv'), 130.69138);
   -1   201         shared.similar(renderer.value('pf-chroma(blue, "luv")'), 130.69138);
  208   202       });
  209   203     });
  210   204 
  211   205     describe('pf-hue', function() {
  212   206       it('white', function() {
  213    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('white', 'luv'), 0);
   -1   207         shared.similar(renderer.value('pf-hue(white, "luv")'), 0);
  214   208       });
  215   209       it('black', function() {
  216    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('black', 'luv'), 0);
   -1   210         shared.similar(renderer.value('pf-hue(black, "luv")'), 0);
  217   211       });
  218   212       it('red', function() {
  219    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('red', 'luv'), 12.17245);
   -1   213         shared.similar(renderer.value('pf-hue(red, "luv")'), 12.17245);
  220   214       });
  221   215       it('yellow', function() {
  222    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('yellow', 'luv'), 85.87536);
   -1   216         shared.similar(renderer.value('pf-hue(yellow, "luv")'), 85.87536);
  223   217       });
  224   218       it('green', function() {
  225    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('green', 'luv'), 127.71994);
   -1   219         shared.similar(renderer.value('pf-hue(green, "luv")'), 127.71994);
  226   220       });
  227   221       it('blue', function() {
  228    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('blue', 'luv'), -94.12464);
   -1   222         shared.similar(renderer.value('pf-hue(blue, "luv")'), -94.12464);
  229   223       });
  230   224     });
  231   225 
  232   226     describe('pf-complement', function() {
  233   227       it('white', function() {
  234    -1         sassaby.func('pf-complement').calledWithArgs('white', 'luv').equals('white');
   -1   228         assert.equal(renderer.value('pf-complement(white, "luv")'), 'white')
  235   229       });
  236   230       it('red', function() {
  237    -1         sassaby.func('pf-complement').calledWithArgs('red', 'luv').equals('#008e8e');
   -1   231         assert.equal(renderer.value('pf-complement(red, "luv")'), '#008e8e')
  238   232       });
  239   233       it('yellow', function() {
  240    -1         sassaby.func('pf-complement').calledWithArgs('yellow', 'luv').equals('#f6f6ff');
   -1   234         assert.equal(renderer.value('pf-complement(yellow, "luv")'), '#f6f6ff')
  241   235       });
  242   236     });
  243   237 
  244   238     describe('pf-mix', function() {
  245   239       it('white, white', function() {
  246    -1         sassaby.func('pf-mix').calledWithArgs('white', 'white', '50%', 'luv').equals('white');
   -1   240         assert.equal(renderer.value('pf-mix(white, white, 50%, "luv")'), 'white')
  247   241       });
  248   242       it('black, white', function() {
  249    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '50%', 'luv').equals('#777');
   -1   243         assert.equal(renderer.value('pf-mix(black, white, 50%, "luv")'), '#777777')
  250   244       });
  251   245       it('black, white, 0%', function() {
  252    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '0%', 'luv').equals('white');
   -1   246         assert.equal(renderer.value('pf-mix(black, white, 0%, "luv")'), 'white')
  253   247       });
  254   248       it('black, white, 100%', function() {
  255    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '100%', 'luv').equals('black');
   -1   249         assert.equal(renderer.value('pf-mix(black, white, 100%, "luv")'), 'black')
  256   250       });
  257   251       it('black, white, 20%', function() {
  258    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '20%', 'luv').equals('#c6c6c6');
   -1   252         assert.equal(renderer.value('pf-mix(black, white, 20%, "luv")'), '#c6c6c6')
  259   253       });
  260    -1       it('black, white, .2', function() {
  261    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '.2', 'luv').equals('#c6c6c6');
   -1   254       it('black, white, 0.2', function() {
   -1   255         assert.equal(renderer.value('pf-mix(black, white, 0.2, "luv")'), '#c6c6c6')
  262   256       });
  263   257       it('blue, red', function() {
  264    -1         sassaby.func('pf-mix').calledWithArgs('blue', 'red', '50%', 'luv').equals('#bd0095');
   -1   258         assert.equal(renderer.value('pf-mix(blue, red, 50%, "luv")'), '#bd0095')
  265   259       });
  266   260       it('blue, red, 20%', function() {
  267    -1         sassaby.func('pf-mix').calledWithArgs('blue', 'red', '20%', 'luv').equals('#e40070');
   -1   261         assert.equal(renderer.value('pf-mix(blue, red, 20%, "luv")'), '#e40070')
  268   262       });
  269   263       it('green, red', function() {
  270    -1         sassaby.func('pf-mix').calledWithArgs('green', 'red', '50%', 'luv').equals('#a56a00');
   -1   264         assert.equal(renderer.value('pf-mix(green, red, 50%, "luv")'), '#a56a00')
  271   265       });
  272   266       it('yellow, blue', function() {
  273    -1         sassaby.func('pf-mix').calledWithArgs('yellow', 'blue', '50%', 'luv').equals('#ff66ab');
   -1   267         assert.equal(renderer.value('pf-mix(yellow, blue, 50%, "luv")'), '#ff66ab')
  274   268       });
  275   269       it('green, blue', function() {
  276    -1         sassaby.func('pf-mix').calledWithArgs('green', 'blue', '50%', 'luv').equals('#006678');
   -1   270         assert.equal(renderer.value('pf-mix(green, blue, 50%, "luv")'), '#006678')
  277   271       });
  278   272       it('white, blue', function() {
  279    -1         sassaby.func('pf-mix').calledWithArgs('white', 'blue', '50%', 'luv').equals('#9999e8');
   -1   273         assert.equal(renderer.value('pf-mix(white, blue, 50%, "luv")'), '#9999e8')
  280   274       });
  281   275     });
  282   276   });
@@ -284,109 +278,109 @@ describe('color', function() {
  284   278   describe('hsl', function() {
  285   279     describe('lch', function() {
  286   280       it('white', function() {
  287    -1         sassaby.func('lch').calledWithArgs('100', '0', '0rad', 'hsl').equals('white');
   -1   281         assert.equal(renderer.value('lch(100, 0, 0rad, "hsl")'), 'white')
  288   282       });
  289   283       it('black', function() {
  290    -1         sassaby.func('lch').calledWithArgs('0', '0', '0rad', 'hsl').equals('black');
   -1   284         assert.equal(renderer.value('lch(0, 0, 0rad, "hsl")'), 'black')
  291   285       });
  292   286       it('red', function() {
  293    -1         sassaby.func('lch').calledWithArgs('50', '100', '0rad', 'hsl').equals('red');
   -1   287         assert.equal(renderer.value('lch(50, 100, 0rad, "hsl")'), 'red')
  294   288       });
  295   289       it('blue (rad)', function() {
  296    -1         sassaby.func('lch').calledWithArgs('50', '100', '4.18879rad', 'hsl').equals('blue');
   -1   290         assert.equal(renderer.value('lch(50, 100, 4.18879rad, "hsl")'), 'blue')
  297   291       });
  298   292       it('blue (deg)', function() {
  299    -1         sassaby.func('lch').calledWithArgs('50', '100', '240deg', 'hsl').equals('blue');
   -1   293         assert.equal(renderer.value('lch(50, 100, 240deg, "hsl")'), 'blue')
  300   294       });
  301   295       it('blue (unitless)', function() {
  302    -1         sassaby.func('lch').calledWithArgs('50', '100', '240', 'hsl').equals('blue');
   -1   296         assert.equal(renderer.value('lch(50, 100, 240, "hsl")'), 'blue')
  303   297       });
  304   298     });
  305   299 
  306   300     describe('pf-lightness', function() {
  307   301       it('white', function() {
  308    -1         sassaby.func('pf-lightness').calledWithArgs('white', 'hsl').equals(100);
   -1   302         assert.equal(renderer.value('pf-lightness(white, "hsl")'), 100)
  309   303       });
  310   304       it('black', function() {
  311    -1         sassaby.func('pf-lightness').calledWithArgs('black', 'hsl').equals(0);
   -1   305         assert.equal(renderer.value('pf-lightness(black, "hsl")'), 0)
  312   306       });
  313   307       it('red', function() {
  314    -1         sassaby.func('pf-lightness').calledWithArgs('red', 'hsl').equals(50);
   -1   308         assert.equal(renderer.value('pf-lightness(red, "hsl")'), 50)
  315   309       });
  316   310       it('blue', function() {
  317    -1         sassaby.func('pf-lightness').calledWithArgs('blue', 'hsl').equals(50);
   -1   311         assert.equal(renderer.value('pf-lightness(blue, "hsl")'), 50)
  318   312       });
  319   313     });
  320   314 
  321   315     describe('pf-chroma', function() {
  322   316       it('white', function() {
  323    -1         sassaby.func('pf-chroma').calledWithArgs('white', 'hsl').equals(0);
   -1   317         assert.equal(renderer.value('pf-chroma(white, "hsl")'), 0)
  324   318       });
  325   319       it('black', function() {
  326    -1         sassaby.func('pf-chroma').calledWithArgs('black', 'hsl').equals(0);
   -1   320         assert.equal(renderer.value('pf-chroma(black, "hsl")'), 0)
  327   321       });
  328   322       it('red', function() {
  329    -1         sassaby.func('pf-chroma').calledWithArgs('red', 'hsl').equals(100);
   -1   323         assert.equal(renderer.value('pf-chroma(red, "hsl")'), 100)
  330   324       });
  331   325       it('blue', function() {
  332    -1         sassaby.func('pf-chroma').calledWithArgs('blue', 'hsl').equals(100);
   -1   326         assert.equal(renderer.value('pf-chroma(blue, "hsl")'), 100)
  333   327       });
  334   328     });
  335   329 
  336   330     describe('pf-hue', function() {
  337   331       it('white', function() {
  338    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('white', 'hsl'), 0);
   -1   332         shared.similar(renderer.value('pf-hue(white, "hsl")'), 0);
  339   333       });
  340   334       it('black', function() {
  341    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('black', 'hsl'), 0);
   -1   335         shared.similar(renderer.value('pf-hue(black, "hsl")'), 0);
  342   336       });
  343   337       it('red', function() {
  344    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('red', 'hsl'), 0);
   -1   338         shared.similar(renderer.value('pf-hue(red, "hsl")'), 0);
  345   339       });
  346   340       it('yellow', function() {
  347    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('yellow', 'hsl'), 60);
   -1   341         shared.similar(renderer.value('pf-hue(yellow, "hsl")'), 60);
  348   342       });
  349   343       it('green', function() {
  350    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('green', 'hsl'), 120);
   -1   344         shared.similar(renderer.value('pf-hue(green, "hsl")'), 120);
  351   345       });
  352   346       it('blue', function() {
  353    -1         shared.similar(sassaby.func('pf-hue').calledWithArgs('blue', 'hsl'), 240);
   -1   347         shared.similar(renderer.value('pf-hue(blue, "hsl")'), 240);
  354   348       });
  355   349     });
  356   350 
  357   351     describe('pf-complement', function() {
  358   352       it('white', function() {
  359    -1         sassaby.func('pf-complement').calledWithArgs('white', 'hsl').equals('white');
   -1   353         assert.equal(renderer.value('pf-complement(white, "hsl")'), 'white')
  360   354       });
  361   355       it('red', function() {
  362    -1         sassaby.func('pf-complement').calledWithArgs('red', 'hsl').equals('cyan');
   -1   356         assert.equal(renderer.value('pf-complement(red, "hsl")'), 'cyan')
  363   357       });
  364   358       it('yellow', function() {
  365    -1         sassaby.func('pf-complement').calledWithArgs('yellow', 'hsl').equals('blue');
   -1   359         assert.equal(renderer.value('pf-complement(yellow, "hsl")'), 'blue')
  366   360       });
  367   361     });
  368   362 
  369   363     describe('pf-mix', function() {
  370   364       it('white, white', function() {
  371    -1         sassaby.func('pf-mix').calledWithArgs('white', 'white', '50%', 'hsl').equals('white');
   -1   365         assert.equal(renderer.value('pf-mix(white, white, 50%, "hsl")'), 'white')
  372   366       });
  373   367       it('black, white', function() {
  374    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '50%', 'hsl').equals('gray');
   -1   368         assert.equal(renderer.value('pf-mix(black, white, 50%, "hsl")'), 'gray')
  375   369       });
  376   370       it('black, white, 0%', function() {
  377    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '0%', 'hsl').equals('white');
   -1   371         assert.equal(renderer.value('pf-mix(black, white, 0%, "hsl")'), 'white')
  378   372       });
  379   373       it('black, white, 100%', function() {
  380    -1         sassaby.func('pf-mix').calledWithArgs('black', 'white', '100%', 'hsl').equals('black');
   -1   374         assert.equal(renderer.value('pf-mix(black, white, 100%, "hsl")'), 'black')
  381   375       });
  382   376       it('blue, red', function() {
  383    -1         sassaby.func('pf-mix').calledWithArgs('blue', 'red', '50%', 'hsl').equals('magenta');
   -1   377         assert.equal(renderer.value('pf-mix(blue, red, 50%, "hsl")'), 'magenta')
  384   378       });
  385   379       it('yellow, blue', function() {
  386    -1         sassaby.func('pf-mix').calledWithArgs('yellow', 'blue', '50%', 'hsl').equals('#00ff80');
   -1   380         assert.equal(renderer.value('pf-mix(yellow, blue, 50%, "hsl")'), '#00ff80')
  387   381       });
  388   382       it('white, blue', function() {
  389    -1         sassaby.func('pf-mix').calledWithArgs('white', 'blue', '50%', 'hsl').equals('#9f9fdf');
   -1   383         assert.equal(renderer.value('pf-mix(white, blue, 50%, "hsl")'), '#9f9fdf')
  390   384       });
  391   385     });
  392   386   });

diff --git a/test/contrast.js b/test/contrast.js

@@ -1,149 +1,143 @@
    1    -1 var path = require('path');
    2    -1 var Sassaby = require('sassaby');
   -1     1 var assert = require('assert');
    3     2 var shared = require('./shared');
    4     3 
    5     4 describe('contrast', function() {
    6    -1   var file = path.resolve(__dirname, '../sass/contrast.scss');
    7    -1   var sassaby = new Sassaby(file, {
    8    -1     dependencies: [
    9    -1       path.resolve(__dirname, '../sass/math.scss')
   10    -1     ]
   11    -1   });
   -1     5   var renderer = new shared.Renderer('@import "contrast";');
   12     6 
   13     7   describe('alpha-blend', function() {
   14     8     it('fully opaque', function() {
   15    -1       sassaby.func('alpha-blend').calledWithArgs('white').equals('white');
   16    -1       sassaby.func('alpha-blend').calledWithArgs('black').equals('black');
   17    -1       sassaby.func('alpha-blend').calledWithArgs('red').equals('red');
   -1     9       assert.equal(renderer.value('alpha-blend(white)'), 'white')
   -1    10       assert.equal(renderer.value('alpha-blend(black)'), 'black')
   -1    11       assert.equal(renderer.value('alpha-blend(red)'), 'red')
   18    12     });
   19    13     it('fully transparent', function() {
   20    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(white, 0)', 'blue').equals('blue');
   21    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(black, 0)', 'blue').equals('blue');
   22    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(red, 0)', 'blue').equals('blue');
   23    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(blue, 0)').equals('white');
   -1    14       assert.equal(renderer.value('alpha-blend(rgba(white, 0), blue)'), 'blue')
   -1    15       assert.equal(renderer.value('alpha-blend(rgba(black, 0), blue)'), 'blue')
   -1    16       assert.equal(renderer.value('alpha-blend(rgba(red, 0), blue)'), 'blue')
   -1    17       assert.equal(renderer.value('alpha-blend(rgba(blue, 0))'), 'white')
   24    18     });
   25    19     it('50%', function() {
   26    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(white, 0.5)', 'blue').equals('#8080ff');
   27    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(black, 0.5)', 'blue').equals('navy');
   28    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(red, 0.5)', 'blue').equals('purple');
   29    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(blue, 0.5)').equals('#8080ff');
   -1    20       assert.equal(renderer.value('alpha-blend(rgba(white, 0.5), blue)'), '#8080ff')
   -1    21       assert.equal(renderer.value('alpha-blend(rgba(black, 0.5), blue)'), 'navy')
   -1    22       assert.equal(renderer.value('alpha-blend(rgba(red, 0.5), blue)'), 'purple')
   -1    23       assert.equal(renderer.value('alpha-blend(rgba(blue, 0.5))'), '#8080ff')
   30    24     });
   31    25     it('13%', function() {
   32    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(white, 0.13)', 'blue').equals('#2121ff');
   33    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(black, 0.13)', 'blue').equals('#0000de');
   34    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(red, 0.13)', 'blue').equals('#2100de');
   35    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(blue, 0.13)').equals('#dedeff');
   -1    26       assert.equal(renderer.value('alpha-blend(rgba(white, 0.13), blue)'), '#2121ff')
   -1    27       assert.equal(renderer.value('alpha-blend(rgba(black, 0.13), blue)'), '#0000de')
   -1    28       assert.equal(renderer.value('alpha-blend(rgba(red, 0.13), blue)'), '#2100de')
   -1    29       assert.equal(renderer.value('alpha-blend(rgba(blue, 0.13))'), '#dedeff')
   36    30     });
   37    31     it('transparent background', function() {
   38    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(white, 0.5)', 'rgba(blue, 0.5)').equals('rgba(170,170,255,0.75)');
   -1    32       assert.equal(renderer.value('alpha-blend(rgba(white, 0.5), rgba(blue, 0.5))'), 'rgba(170, 170, 255, 0.75)')
   39    33     });
   40    34     it('both fully transparent', function() {
   41    -1       sassaby.func('alpha-blend').calledWithArgs('rgba(white, 0)', 'rgba(black, 0)').equals('rgba(255,255,255,0)');
   -1    35       assert.equal(renderer.value('alpha-blend(rgba(white, 0), rgba(black, 0))'), 'rgba(255, 255, 255, 0)')
   42    36     });
   43    37   });
   44    38 
   45    39   describe('luma', function() {
   46    40     it('white', function() {
   47    -1       sassaby.func('luma').calledWithArgs('white').equals('1');
   -1    41       assert.equal(renderer.value('luma(white)'), '1')
   48    42     });
   49    43     it('black', function() {
   50    -1       sassaby.func('luma').calledWithArgs('black').equals('0');
   -1    44       assert.equal(renderer.value('luma(black)'), '0')
   51    45     });
   52    46     it('red', function() {
   53    -1       sassaby.func('luma').calledWithArgs('#f00').equals('.2126');
   -1    47       assert.equal(renderer.value('luma(#f00)'), '0.2126')
   54    48     });
   55    49     it('green', function() {
   56    -1       sassaby.func('luma').calledWithArgs('#0f0').equals('.7152');
   -1    50       assert.equal(renderer.value('luma(#0f0)'), '0.7152')
   57    51     });
   58    52     it('blue', function() {
   59    -1       sassaby.func('luma').calledWithArgs('#00f').equals('.0722');
   -1    53       assert.equal(renderer.value('luma(#00f)'), '0.0722')
   60    54     });
   61    55     it('yellow', function() {
   62    -1       sassaby.func('luma').calledWithArgs('yellow').equals('.9278');
   -1    56       assert.equal(renderer.value('luma(yellow)'), '0.9278')
   63    57     });
   64    58     it('cyan', function() {
   65    -1       sassaby.func('luma').calledWithArgs('cyan').equals('.7874');
   -1    59       assert.equal(renderer.value('luma(cyan)'), '0.7874')
   66    60     });
   67    61     it('random', function() {
   68    -1       shared.similar(sassaby.func('luma').calledWithArgs('rgb(12, 180, 92)'), 0.3349, 0.02);
   -1    62       shared.similar(renderer.value('luma(rgb(12, 180, 92))'), 0.3349, 0.02);
   69    63     });
   70    64     it('white with alpha', function() {
   71    -1       sassaby.func('luma').calledWithArgs('rgba(255,255,255,0.5)').equals('1');
   -1    65       assert.equal(renderer.value('luma(rgba(255,255,255,0.5))'), '1')
   72    66     });
   73    67     it('black with alpha', function() {
   74    -1       sassaby.func('luma').calledWithArgs('rgba(0,0,0,0.5)').equals('0');
   -1    68       assert.equal(renderer.value('luma(rgba(0,0,0,0.5))'), '0')
   75    69     });
   76    70   });
   77    71 
   78    72   describe('contrast', function() {
   79    73     it('white-black', function() {
   80    -1       sassaby.func('contrast').calledWithArgs('white', 'black').equals('21');
   -1    74       assert.equal(renderer.value('contrast(white, black)'), '21')
   81    75     });
   82    76     it('white-white', function() {
   83    -1       sassaby.func('contrast').calledWithArgs('white', 'white').equals('1');
   -1    77       assert.equal(renderer.value('contrast(white, white)'), '1')
   84    78     });
   85    79     it('black-black', function() {
   86    -1       sassaby.func('contrast').calledWithArgs('black', 'black').equals('1');
   -1    80       assert.equal(renderer.value('contrast(black, black)'), '1')
   87    81     });
   88    82     it('red-red', function() {
   89    -1       sassaby.func('contrast').calledWithArgs('red', 'red').equals('1');
   -1    83       assert.equal(renderer.value('contrast(red, red)'), '1')
   90    84     });
   91    85     it('red-lightblue', function() {
   92    -1       shared.similar(sassaby.func('contrast').calledWithArgs('red', '#676eff'), 1, 0.02);
   -1    86       shared.similar(renderer.value('contrast(red, #676eff)'), 1, 0.02);
   93    87     });
   94    88   });
   95    89 
   96    90   describe('contrast-color', function() {
   97    91     it('white', function() {
   98    -1       sassaby.func('contrast-color').calledWithArgs('white').equals('black');
   -1    92       assert.equal(renderer.value('contrast-color(white)'), 'black')
   99    93     });
  100    94     it('black', function() {
  101    -1       sassaby.func('contrast-color').calledWithArgs('black').equals('white');
   -1    95       assert.equal(renderer.value('contrast-color(black)'), 'white')
  102    96     });
  103    97     it('red', function() {
  104    -1       sassaby.func('contrast-color').calledWithArgs('#f00').equals('black');
   -1    98       assert.equal(renderer.value('contrast-color(#f00)'), 'black')
  105    99     });
  106   100     it('green', function() {
  107    -1       sassaby.func('contrast-color').calledWithArgs('#0f0').equals('black');
   -1   101       assert.equal(renderer.value('contrast-color(#0f0)'), 'black')
  108   102     });
  109   103     it('blue', function() {
  110    -1       sassaby.func('contrast-color').calledWithArgs('#00f').equals('white');
   -1   104       assert.equal(renderer.value('contrast-color(#00f)'), 'white')
  111   105     });
  112   106     it('yellow', function() {
  113    -1       sassaby.func('contrast-color').calledWithArgs('yellow').equals('black');
   -1   107       assert.equal(renderer.value('contrast-color(yellow)'), 'black')
  114   108     });
  115   109     it('cyan', function() {
  116    -1       sassaby.func('contrast-color').calledWithArgs('cyan').equals('black');
   -1   110       assert.equal(renderer.value('contrast-color(cyan)'), 'black')
  117   111     });
  118   112     it('light', function() {
  119    -1       sassaby.func('contrast-color').calledWithArgs('white', '#111', '#eee').equals('#111');
   -1   113       assert.equal(renderer.value('contrast-color(white, #111, #eee)'), '#111')
  120   114     });
  121   115     it('dark', function() {
  122    -1       sassaby.func('contrast-color').calledWithArgs('black', '#111', '#eee').equals('#eee');
   -1   116       assert.equal(renderer.value('contrast-color(black, #111, #eee)'), '#eee')
  123   117     });
  124   118     it('middle', function() {
  125    -1       sassaby.func('contrast-color').calledWithArgs('#555', '#111', '#eee').equals('#eee');
   -1   119       assert.equal(renderer.value('contrast-color(#555, #111, #eee)'), '#eee')
  126   120     });
  127   121     it('swapped', function() {
  128    -1       sassaby.func('contrast-color').calledWithArgs('white', '#eee', '#111').equals('#111');
   -1   122       assert.equal(renderer.value('contrast-color(white, #eee, #111)'), '#111')
  129   123     });
  130   124   });
  131   125 
  132   126   describe('contrast-stretch', function() {
  133   127     it('white-black', function() {
  134    -1       sassaby.func('contrast-stretch').calledWithArgs('white', 'black').equals('black');
   -1   128       assert.equal(renderer.value('contrast-stretch(white, black)'), 'black')
  135   129     });
  136   130     it('white-#333', function() {
  137    -1       sassaby.func('contrast-stretch').calledWithArgs('white', '#333').equals('#333');
   -1   131       assert.equal(renderer.value('contrast-stretch(white, #333)'), '#333')
  138   132     });
  139   133     it('white-#333-21', function() {
  140    -1       sassaby.func('contrast-stretch').calledWithArgs('white', '#333', '21').equals('black');
   -1   134       assert.equal(renderer.value('contrast-stretch(white, #333, 21)'), 'black')
  141   135     });
  142   136     it('#333-blue-7', function() {
  143    -1       sassaby.func('contrast-stretch').calledWithArgs('#333', 'blue', '7').equals('#bbf');
   -1   137       assert.equal(renderer.value('contrast-stretch(#333, blue, 7)'), '#bdbdff')
  144   138     });
  145   139     it('#333-blue-AAA', function() {
  146    -1       sassaby.func('contrast-stretch').calledWithArgs('#333', 'blue', 'AAA').equals('#bbf');
   -1   140       assert.equal(renderer.value('contrast-stretch(#333, blue, "AAA")'), '#bdbdff')
  147   141     });
  148   142   });
  149   143 });

diff --git a/test/grid.js b/test/grid.js

@@ -1,79 +1,76 @@
    1    -1 var path = require('path');
    2     1 var assert = require('assert');
    3    -1 var Sassaby = require('sassaby');
    4     2 var shared = require('./shared');
    5     3 
    6     4 describe('grid', function() {
    7    -1   var file = path.resolve(__dirname, '../sass/grid.scss');
    8    -1   var sassaby = new Sassaby(file);
   -1     5   var renderer = new shared.Renderer('@import "grid";');
    9     6 
   10     7   describe('_grid-get', function() {
   11     8     it('get value', function() {
   12    -1       sassaby.func('_grid-get').calledWithArgs('columns').equals('12');
   -1     9       assert.equal(renderer.value('_grid-get(columns)'), '12')
   13    10     });
   14    11     it('get overwritten value', function() {
   15    -1       sassaby.func('_grid-get').calledWithArgs('columns', '("columns": 13)').equals(13);
   -1    12       assert.equal(renderer.value('_grid-get(columns, ("columns": 13))'), 13)
   16    13     });
   17    14   });
   18    15 
   19    16   describe('grid-width', function() {
   20    17     it('uses calc() for output', function() {
   21    -1       var call = sassaby.includedMixin('grid-width').calledWithArgs('1');
   22    -1       shared.declares(call, 'width', 'calc((100% + 1rem) * .08333 - 1rem)');
   -1    18       var call = renderer.block('@include grid-width(1)')
   -1    19       shared.declares(call, 'width', 'calc((100% + 1rem) * 0.08333 - 1rem)');
   23    20     });
   24    21     it('provides a fallback', function() {
   25    -1       var call = sassaby.includedMixin('grid-width').calledWithArgs('1');
   -1    22       var call = renderer.block('@include grid-width(1)')
   26    23       shared.declares(call, 'width', '6.5%');
   27    24     });
   28    25     it('grid-width(2)', function() {
   29    -1       var call = sassaby.includedMixin('grid-width').calledWithArgs('2');
   30    -1       shared.declares(call, 'width', 'calc((100% + 1rem) * .16667 - 1rem)');
   -1    26       var call = renderer.block('@include grid-width(2)')
   -1    27       shared.declares(call, 'width', 'calc((100% + 1rem) * 0.16667 - 1rem)');
   31    28       shared.declares(call, 'width', '15%');
   32    29     });
   33    30     it('uses gutter setting', function() {
   34    -1       var call = sassaby.includedMixin('grid-width').calledWithArgs('1', '(gutter: 2em)');
   35    -1       shared.declares(call, 'width', 'calc((100% + 2em) * .08333 - 2em)');
   -1    31       var call = renderer.block('@include grid-width(1, (gutter: 2em))')
   -1    32       shared.declares(call, 'width', 'calc((100% + 2em) * 0.08333 - 2em)');
   36    33       shared.declares(call, 'width', '6.5%');
   37    34     });
   38    35     it('uses gutter-fallback setting', function() {
   39    -1       var call = sassaby.includedMixin('grid-width').calledWithArgs('1', '(gutter-fallback: 8%)');
   40    -1       shared.declares(call, 'width', 'calc((100% + 1rem) * .08333 - 1rem)');
   -1    36       var call = renderer.block('@include grid-width(1, (gutter-fallback: 8%))')
   -1    37       shared.declares(call, 'width', 'calc((100% + 1rem) * 0.08333 - 1rem)');
   41    38       shared.declares(call, 'width', '1%');
   42    39     });
   43    40     it('uses columns setting', function() {
   44    -1       var call = sassaby.includedMixin('grid-width').calledWithArgs('1', '(columns: 8)');
   45    -1       shared.declares(call, 'width', 'calc((100% + 1rem) * .125 - 1rem)');
   -1    41       var call = renderer.block('@include grid-width(1, (columns: 8))')
   -1    42       shared.declares(call, 'width', 'calc((100% + 1rem) * 0.125 - 1rem)');
   46    43       shared.declares(call, 'width', '10.75%');
   47    44     });
   48    45   });
   49    46 
   50    47   describe('grid-position', function() {
   51    48     it('uses calc() for output', function() {
   52    -1       var call = sassaby.includedMixin('grid-position').calledWithArgs('1');
   53    -1       shared.declares(call, 'margin-left', 'calc((100% + 1rem) * .08333)');
   -1    49       var call = renderer.block('@include grid-position(1)')
   -1    50       shared.declares(call, 'margin-left', 'calc((100% + 1rem) * 0.08333)');
   54    51     });
   55    52     it('provides a fallback', function() {
   56    -1       var call = sassaby.includedMixin('grid-position').calledWithArgs('1');
   -1    53       var call = renderer.block('@include grid-position(1)')
   57    54       shared.declares(call, 'margin-left', '8.5%');
   58    55     });
   59    56     it('grid-position(2)', function() {
   60    -1       var call = sassaby.includedMixin('grid-position').calledWithArgs('2');
   61    -1       shared.declares(call, 'margin-left', 'calc((100% + 1rem) * .16667)');
   -1    57       var call = renderer.block('@include grid-position(2)')
   -1    58       shared.declares(call, 'margin-left', 'calc((100% + 1rem) * 0.16667)');
   62    59       shared.declares(call, 'margin-left', '17%');
   63    60     });
   64    61     it('uses gutter setting', function() {
   65    -1       var call = sassaby.includedMixin('grid-position').calledWithArgs('1', '(gutter: 2em)');
   66    -1       shared.declares(call, 'margin-left', 'calc((100% + 2em) * .08333)');
   -1    62       var call = renderer.block('@include grid-position(1, (gutter: 2em))')
   -1    63       shared.declares(call, 'margin-left', 'calc((100% + 2em) * 0.08333)');
   67    64       shared.declares(call, 'margin-left', '8.5%');
   68    65     });
   69    66     it('uses gutter-fallback setting', function() {
   70    -1       var call = sassaby.includedMixin('grid-position').calledWithArgs('1', '(gutter-fallback: 8%)');
   71    -1       shared.declares(call, 'margin-left', 'calc((100% + 1rem) * .08333)');
   -1    67       var call = renderer.block('@include grid-position(1, (gutter-fallback: 8%))')
   -1    68       shared.declares(call, 'margin-left', 'calc((100% + 1rem) * 0.08333)');
   72    69       shared.declares(call, 'margin-left', '9%');
   73    70     });
   74    71     it('uses columns setting', function() {
   75    -1       var call = sassaby.includedMixin('grid-position').calledWithArgs('1', '(columns: 8)');
   76    -1       shared.declares(call, 'margin-left', 'calc((100% + 1rem) * .125)');
   -1    72       var call = renderer.block('@include grid-position(1, (columns: 8))')
   -1    73       shared.declares(call, 'margin-left', 'calc((100% + 1rem) * 0.125)');
   77    74       shared.declares(call, 'margin-left', '12.75%');
   78    75     });
   79    76   });

diff --git a/test/math.js b/test/math.js

@@ -1,240 +1,237 @@
    1    -1 var path = require('path');
    2     1 var assert = require('assert');
    3    -1 var Sassaby = require('sassaby');
    4     2 var shared = require('./shared');
    5     3 
    6     4 describe('math', function() {
    7    -1   var file = path.resolve(__dirname, '../sass/math.scss');
    8    -1   var sassaby = new Sassaby(file);
   -1     5   var renderer = new shared.Renderer('@import "math";');
    9     6 
   10     7   describe('pow', function() {
   11     8     it('pow(3, 2) == 9', function() {
   12    -1       sassaby.func('pow').calledWithArgs('3', '2').equals('9');
   -1     9       assert.strictEqual(renderer.value('pow(3, 2)'), '9')
   13    10     });
   14    11     it('pow(4, 3/2) == 8', function() {
   15    -1       sassaby.func('pow').calledWithArgs('4', '3/2').equals('8');
   -1    12       assert.strictEqual(renderer.value('pow(4, 3/2)'), '8')
   16    13     });
   17    14     it('pow(144, 1/2) == 12', function() {
   18    -1       sassaby.func('pow').calledWithArgs('144', '1/2').equals('12');
   -1    15       assert.strictEqual(renderer.value('pow(144, 1/2)'), '12')
   19    16     });
   20    17     it('pow(0, 1/2) == 0', function() {
   21    -1       sassaby.func('pow').calledWithArgs('0', '1/2').equals('0');
   -1    18       assert.strictEqual(renderer.value('pow(0, 1/2)'), '0')
   22    19     });
   23    20     it('pow(-3, 2) == 9', function() {
   24    -1       sassaby.func('pow').calledWithArgs('-3', '2').equals('9');
   -1    21       assert.strictEqual(renderer.value('pow(-3, 2)'), '9')
   25    22     });
   26    23     it('pow(-3, 3) == -27', function() {
   27    -1       sassaby.func('pow').calledWithArgs('-3', '3').equals('-27');
   -1    24       assert.strictEqual(renderer.value('pow(-3, 3)'), '-27')
   28    25     });
   29    26     it('pow(3, -2)', function() {
   30    -1       shared.similar(sassaby.func('pow').calledWithArgs('3', '-2'), Math.pow(3, -2));
   -1    27       shared.similar(renderer.value('pow(3, -2)'), Math.pow(3, -2));
   31    28     });
   32    -1     it('pow(64, -1/2) == .125', function() {
   33    -1       sassaby.func('pow').calledWithArgs('64', '-1/2').equals('.125');
   -1    29     it('pow(64, -1/2) == 0.125', function() {
   -1    30       assert.strictEqual(renderer.value('pow(64, -1/2)'), '0.125')
   34    31     });
   35    32     it('pow(1200, 3.4)', function() {
   36    -1       shared.similar(sassaby.func('pow').calledWithArgs('1200', '3.4'), Math.pow(1200, 3.4), 0.1);
   -1    33       shared.similar(renderer.value('pow(1200, 3.4)'), Math.pow(1200, 3.4), 0.1);
   37    34     });
   38    35     it('pow(1200.3, 3.4)', function() {
   39    -1       shared.similar(sassaby.func('pow').calledWithArgs('1200.3', '3.4'), Math.pow(1200.3, 3.4), 0.1);
   -1    36       shared.similar(renderer.value('pow(1200.3, 3.4)'), Math.pow(1200.3, 3.4), 0.1);
   40    37     });
   41    38     it('pow(3px, 2.4) throws', function() {
   42    39       assert.throws(function () {
   43    -1         sassaby.func('pow').calledWithArgs('3px', '2');
   -1    40         renderer.value('pow(3px, 2)');
   44    41       });
   45    42     });
   46    43     it('pow(3.5, 0) == 1', function() {
   47    -1       sassaby.func('pow').calledWithArgs('3.5', '0').equals('1');
   -1    44       assert.strictEqual(renderer.value('pow(3.5, 0)'), '1')
   48    45     });
   49    46     it('pow(0, 3.5) == 0', function() {
   50    -1       sassaby.func('pow').calledWithArgs('0', '3.5').equals('0');
   -1    47       assert.strictEqual(renderer.value('pow(0, 3.5)'), '0')
   51    48     });
   52    49     it('pow(0, 0) == 1', function() {
   53    -1       sassaby.func('pow').calledWithArgs('0', '0').equals('1');
   -1    50       assert.strictEqual(renderer.value('pow(0, 0)'), '1')
   54    51     });
   55    52   });
   56    53 
   57    54   describe('log', function() {
   58    55     it('log(1) == 0', function() {
   59    -1       sassaby.func('log').calledWithArgs('1').equals('0');
   -1    56       assert.strictEqual(renderer.value('log(1)'), '0')
   60    57     });
   61    58     it('log(0.1)', function() {
   62    -1       shared.similar(sassaby.func('log').calledWithArgs('0.1'), Math.log(0.1));
   -1    59       shared.similar(renderer.value('log(0.1)'), Math.log(0.1));
   63    60     });
   64    61     it('log(123456789)', function() {
   65    -1       shared.similar(sassaby.func('log').calledWithArgs('123456789'), Math.log(123456789));
   -1    62       shared.similar(renderer.value('log(123456789)'), Math.log(123456789));
   66    63     });
   67    64     it('log(12345678.9)', function() {
   68    -1       shared.similar(sassaby.func('log').calledWithArgs('12345678.9'), Math.log(12345678.9));
   -1    65       shared.similar(renderer.value('log(12345678.9)'), Math.log(12345678.9));
   69    66     });
   70    67   });
   71    68 
   72    69   describe('sin', function() {
   73    70     it('sin(0) == 0', function() {
   74    -1       sassaby.func('sin').calledWithArgs('0').equals('0');
   -1    71       assert.strictEqual(renderer.value('sin(0)'), '0')
   75    72     });
   76    73     it('sin(pi()) == 0', function() {
   77    -1       sassaby.func('sin').calledWithArgs('pi()').equals('0');
   -1    74       assert.strictEqual(renderer.value('sin(pi())'), '0');
   78    75     });
   79    76     it('sin(2 * pi()) == 0', function() {
   80    -1       sassaby.func('sin').calledWithArgs('2 * pi()').equals('0');
   -1    77       assert.strictEqual(renderer.value('sin(2 * pi())'), '0');
   81    78     });
   82    79     it('sin(123456789 * pi()) ~= 0', function() {
   83    -1       shared.similar(sassaby.func('sin').calledWithArgs('123456789 * pi()'), 0);
   -1    80       shared.similar(renderer.value('sin(123456789 * pi())'), 0);
   84    81     });
   85    82     it('sin(-1 * pi()) == 0', function() {
   86    -1       sassaby.func('sin').calledWithArgs('-1 * pi()').equals('0');
   -1    83       assert.strictEqual(renderer.value('sin(-1 * pi())'), '0');
   87    84     });
   88    85     it('sin(1/2 * pi()) == 1', function() {
   89    -1       sassaby.func('sin').calledWithArgs('1/2 * pi()').equals('1');
   -1    86       assert.strictEqual(renderer.value('sin(1/2 * pi())'), '1');
   90    87     });
   91    88     it('sin(3/2 * pi()) == -1', function() {
   92    -1       sassaby.func('sin').calledWithArgs('3/2 * pi()').equals('-1');
   -1    89       assert.strictEqual(renderer.value('sin(3/2 * pi())'), '-1');
   93    90     });
   94    91     it('sin(1)', function() {
   95    -1       shared.similar(sassaby.func('sin').calledWithArgs('1'), Math.sin(1));
   -1    92       shared.similar(renderer.value('sin(1)'), Math.sin(1));
   96    93     });
   97    94     it('sin(2)', function() {
   98    -1       shared.similar(sassaby.func('sin').calledWithArgs('2'), Math.sin(2));
   -1    95       shared.similar(renderer.value('sin(2)'), Math.sin(2));
   99    96     });
  100    97     it('sin(-1)', function() {
  101    -1       shared.similar(sassaby.func('sin').calledWithArgs('-1'), Math.sin(-1));
   -1    98       shared.similar(renderer.value('sin(-1)'), Math.sin(-1));
  102    99     });
  103   100     it('sin(270deg) == -1', function() {
  104    -1       sassaby.func('sin').calledWithArgs('270deg').equals('-1');
   -1   101       assert.strictEqual(renderer.value('sin(270deg)'), '-1')
  105   102     });
  106   103   });
  107   104 
  108   105   describe('cos', function() {
  109   106     it('cos(0) == 1', function() {
  110    -1       sassaby.func('cos').calledWithArgs('0').equals('1');
   -1   107       assert.strictEqual(renderer.value('cos(0)'), '1')
  111   108     });
  112   109     it('cos(1)', function() {
  113    -1       shared.similar(sassaby.func('cos').calledWithArgs('1'), Math.cos(1));
   -1   110       shared.similar(renderer.value('cos(1)'), Math.cos(1));
  114   111     });
  115   112     it('cos(-2)', function() {
  116    -1       shared.similar(sassaby.func('cos').calledWithArgs('-2'), Math.cos(-2));
   -1   113       shared.similar(renderer.value('cos(-2)'), Math.cos(-2));
  117   114     });
  118   115     it('cos(270deg) == 0', function() {
  119    -1       sassaby.func('cos').calledWithArgs('270deg').equals('0');
   -1   116       assert.strictEqual(renderer.value('cos(270deg)'), '0')
  120   117     });
  121   118   });
  122   119 
  123   120   describe('tan', function() {
  124   121     it('tan(0) == 0', function() {
  125    -1       sassaby.func('tan').calledWithArgs('0').equals('0');
   -1   122       assert.strictEqual(renderer.value('tan(0)'), '0')
  126   123     });
  127   124     it('tan(1)', function() {
  128    -1       shared.similar(sassaby.func('tan').calledWithArgs('1'), Math.tan(1));
   -1   125       shared.similar(renderer.value('tan(1)'), Math.tan(1));
  129   126     });
  130   127     it('tan(-1)', function() {
  131    -1       shared.similar(sassaby.func('tan').calledWithArgs('-1'), Math.tan(-1));
   -1   128       shared.similar(renderer.value('tan(-1)'), Math.tan(-1));
  132   129     });
  133   130     it('tan(12345678.9)', function() {
  134    -1       shared.similar(sassaby.func('tan').calledWithArgs('12345678.9'), Math.tan(12345678.9));
   -1   131       shared.similar(renderer.value('tan(12345678.9)'), Math.tan(12345678.9));
  135   132     });
  136   133     it('tan(45deg) == tan(pi() / 4)', function() {
  137    -1       shared.similar(sassaby.func('tan').calledWithArgs('45deg'), Math.tan(Math.PI / 4));
   -1   134       shared.similar(renderer.value('tan(45deg)'), Math.tan(Math.PI / 4));
  138   135     });
  139   136   });
  140   137 
  141   138   describe('asin', function() {
  142   139     it('asin(0) == 0', function() {
  143    -1       sassaby.func('asin').calledWithArgs('0').equals('0');
   -1   140       assert.strictEqual(renderer.value('asin(0)'), '0')
  144   141     });
  145   142     it('asin(0.1)', function() {
  146    -1       shared.similar(sassaby.func('asin').calledWithArgs('0.1'), Math.asin(0.1));
   -1   143       shared.similar(renderer.value('asin(0.1)'), Math.asin(0.1));
  147   144     });
  148   145     it('asin(0.5)', function() {
  149    -1       shared.similar(sassaby.func('asin').calledWithArgs('0.5'), Math.asin(0.5));
   -1   146       shared.similar(renderer.value('asin(0.5)'), Math.asin(0.5));
  150   147     });
  151   148     it('asin(0.9)', function() {
  152    -1       shared.similar(sassaby.func('asin').calledWithArgs('0.9'), Math.asin(0.9));
   -1   149       shared.similar(renderer.value('asin(0.9)'), Math.asin(0.9));
  153   150     });
  154   151     it('asin(1)', function() {
  155    -1       shared.similar(sassaby.func('asin').calledWithArgs('1'), Math.asin(1));
   -1   152       shared.similar(renderer.value('asin(1)'), Math.asin(1));
  156   153     });
  157   154     it('asin(-0.5)', function() {
  158    -1       shared.similar(sassaby.func('asin').calledWithArgs('-0.5'), Math.asin(-0.5));
   -1   155       shared.similar(renderer.value('asin(-0.5)'), Math.asin(-0.5));
  159   156     });
  160   157     it('asin(2) throws', function() {
  161   158       assert.throws(function () {
  162    -1         sassaby.func('asin').calledWithArgs('2');
   -1   159         renderer.value('asin(2)');
  163   160       });
  164   161     });
  165   162   });
  166   163 
  167   164   describe('acos', function() {
  168   165     it('acos(1) == 0', function() {
  169    -1       sassaby.func('acos').calledWithArgs('1').equals('0');
   -1   166       assert.strictEqual(renderer.value('acos(1)'), '0')
  170   167     });
  171   168     it('acos(0.5)', function() {
  172    -1       shared.similar(sassaby.func('acos').calledWithArgs('0.5'), Math.acos(0.5));
   -1   169       shared.similar(renderer.value('acos(0.5)'), Math.acos(0.5));
  173   170     });
  174   171     it('acos(-0.5)', function() {
  175    -1       shared.similar(sassaby.func('acos').calledWithArgs('-0.5'), Math.acos(-0.5));
   -1   172       shared.similar(renderer.value('acos(-0.5)'), Math.acos(-0.5));
  176   173     });
  177   174     it('acos(2) throws', function() {
  178   175       assert.throws(function () {
  179    -1         sassaby.func('asin').calledWithArgs('2');
   -1   176         renderer.value('asin(2)');
  180   177       });
  181   178     });
  182   179   });
  183   180 
  184   181   describe('atan', function() {
  185   182     it('atan(0) == 0', function() {
  186    -1       sassaby.func('atan').calledWithArgs('0').equals('0');
   -1   183       assert.strictEqual(renderer.value('atan(0)'), '0')
  187   184     });
  188   185     it('atan(0.5)', function() {
  189    -1       shared.similar(sassaby.func('atan').calledWithArgs('0.5'), Math.atan(0.5));
   -1   186       shared.similar(renderer.value('atan(0.5)'), Math.atan(0.5));
  190   187     });
  191   188     it('atan(-0.5)', function() {
  192    -1       shared.similar(sassaby.func('atan').calledWithArgs('-0.5'), Math.atan(-0.5));
   -1   189       shared.similar(renderer.value('atan(-0.5)'), Math.atan(-0.5));
  193   190     });
  194   191     it('atan(12345678.9)', function() {
  195    -1       shared.similar(sassaby.func('atan').calledWithArgs('12345678.9'), Math.atan(12345678.9));
   -1   192       shared.similar(renderer.value('atan(12345678.9)'), Math.atan(12345678.9));
  196   193     });
  197   194   });
  198   195 
  199   196   describe('atan2', function() {
  200   197     it('atan2(0, 1) == 0', function() {
  201    -1       sassaby.func('atan2').calledWithArgs('0', '1').equals('0');
   -1   198       assert.strictEqual(renderer.value('atan2(0, 1)'), '0')
  202   199     });
  203   200     it('atan2(1, 0)', function() {
  204    -1       shared.similar(sassaby.func('atan2').calledWithArgs('1', '0'), Math.atan2(1, 0));
   -1   201       shared.similar(renderer.value('atan2(1, 0)'), Math.atan2(1, 0));
  205   202     });
  206   203     it('atan2(0, -1)', function() {
  207    -1       shared.similar(sassaby.func('atan2').calledWithArgs('0', '-1'), Math.atan2(0, -1));
   -1   204       shared.similar(renderer.value('atan2(0, -1)'), Math.atan2(0, -1));
  208   205     });
  209   206     it('atan2(-1, 0)', function() {
  210    -1       shared.similar(sassaby.func('atan2').calledWithArgs('-1', '0'), Math.atan2(-1, 0));
   -1   207       shared.similar(renderer.value('atan2(-1, 0)'), Math.atan2(-1, 0));
  211   208     });
  212   209     it('atan2(2, 0)', function() {
  213    -1       shared.similar(sassaby.func('atan2').calledWithArgs('2', '0'), Math.atan2(2, 0));
   -1   210       shared.similar(renderer.value('atan2(2, 0)'), Math.atan2(2, 0));
  214   211     });
  215   212     it('atan2(-1, -1)', function() {
  216    -1       shared.similar(sassaby.func('atan2').calledWithArgs('-1', '-1'), Math.atan2(-1, -1));
   -1   213       shared.similar(renderer.value('atan2(-1, -1)'), Math.atan2(-1, -1));
  217   214     });
  218   215   });
  219   216 
  220   217   describe('bezier', function() {
  221    -1     it('bezier((0 0, 1 1), 0.5) == .5 .5', function() {
  222    -1       sassaby.func('bezier').calledWithArgs('(0 0, 1 1)', '0.5').equals('.5 .5');
   -1   218     it('bezier((0 0, 1 1), 0.5) == 0.5 0.5', function() {
   -1   219       assert.strictEqual(renderer.value('bezier((0 0, 1 1), 0.5)'), '0.5 0.5');
  223   220     });
  224    -1     it('bezier((0 0, .2 .2, 1 1), 0.5) == .35 .35', function() {
  225    -1       sassaby.func('bezier').calledWithArgs('(0 0, .2 .2, 1 1)', '0.5').equals('.35 .35');
   -1   221     it('bezier((0 0, 0.2 0.2, 1 1), 0.5) == 0.35 0.35', function() {
   -1   222       assert.strictEqual(renderer.value('bezier((0 0, 0.2 0.2, 1 1), 0.5)'), '0.35 0.35');
  226   223     });
  227    -1     it('bezier((0 0, .5 .2, 1 1), 0.5) == .5 .35', function() {
  228    -1       sassaby.func('bezier').calledWithArgs('(0 0, .5 .2, 1 1)', '0.5').equals('.5 .35');
   -1   224     it('bezier((0 0, 0.5 0.2, 1 1), 0.5) == 0.5 0.35', function() {
   -1   225       assert.strictEqual(renderer.value('bezier((0 0, 0.5 0.2, 1 1), 0.5)'), '0.5 0.35');
  229   226     });
  230    -1     it('bezier((0, 1), 0.5) == .5', function() {
  231    -1       sassaby.func('bezier').calledWithArgs('(0, 1)', '0.5').equals('.5');
   -1   227     it('bezier((0, 1), 0.5) == 0.5', function() {
   -1   228       assert.strictEqual(renderer.value('bezier((0, 1), 0.5)'), '0.5');
  232   229     });
  233   230     it('bezier((0, 2), 0.5) == 1', function() {
  234    -1       sassaby.func('bezier').calledWithArgs('(0, 2)', '0.5').equals('1');
   -1   231       assert.strictEqual(renderer.value('bezier((0, 2), 0.5)'), '1');
  235   232     });
  236    -1     it('bezier((0 0 0, 1 1 1), 0.5) == .5 .5 .5', function() {
  237    -1       sassaby.func('bezier').calledWithArgs('(0 0 0, 1 1 1)', '0.5').equals('.5 .5 .5');
   -1   233     it('bezier((0 0 0, 1 1 1), 0.5) == 0.5 0.5 0.5', function() {
   -1   234       assert.strictEqual(renderer.value('bezier((0 0 0, 1 1 1), 0.5)'), '0.5 0.5 0.5');
  238   235     });
  239   236   });
  240   237 });

diff --git a/test/shared.js b/test/shared.js

@@ -1,22 +1,41 @@
   -1     1 var path = require('path');
   -1     2 var sass = require('node-sass');
    1     3 var assert = require('assert');
    2     4 
   -1     5 var Renderer = function(head) {
   -1     6   this.head = head;
   -1     7 }
   -1     8 
   -1     9 Renderer.prototype.block = function(input) {
   -1    10   var result = sass.renderSync({
   -1    11     data: this.head + ' .test{' + input + '}',
   -1    12     outputStyle: 'compact',
   -1    13     includePaths: [path.resolve(__dirname, '../sass/')],
   -1    14   });
   -1    15   return result.css.utf8Slice().slice(8, -3);
   -1    16 };
   -1    17 
   -1    18 Renderer.prototype.value = function(input) {
   -1    19   return this.block('content:' + input).slice(9, -1);
   -1    20 };
   -1    21 
    3    22 var similar = function(result, actual, threshold) {
    4    23   if (threshold === void 0) {
    5    24     threshold = 0.00001;
    6    25   }
    7    26 
    8    -1   var value = parseFloat(/^\.test{content:(.*)}$/.exec(result.css)[1]);
   -1    27   var value = parseFloat(result);
    9    28   var message = 'Function: ' + value + ' is not similar to ' + actual + '.';
   10    29   assert(Math.abs(value - actual) < threshold, message);
   11    30 };
   12    31 
   13    32 var declares = function(result, key, value) {
   14    -1   var rules = result.css.split(/[{};]/);
   -1    33   var rules = result.split(/[{};]/);
   15    34   var found = false;
   16    35   var values = [];
   17    36 
   18    37   for (var i = 0; i < rules.length; i++) {
   19    -1     var rule = rules[i].split(':');
   -1    38     var rule = rules[i].split(':').map(x => x.trim());
   20    39 
   21    40     if (rule.length == 2 && rule[0] == key) {
   22    41       values.push(rule[1]);
@@ -34,6 +53,7 @@ var declares = function(result, key, value) {
   34    53 };
   35    54 
   36    55 module.exports = {
   -1    56   Renderer: Renderer,
   37    57   similar: similar,
   38    58   declares: declares,
   39    59 };