// Jasmine unit tests
// To run tests, run these commands from the project root:
// 1. `npm install -g jasmine-node`
// 2. `jasmine-node spec`

'use strict';
var fs = require('fs');
var pixrem = require('../lib/pixrem');
var css = '.rule { font-size: 2rem }';

describe('pixrem', function () {

  it('should generate fallbacks using default settings', function () {
    var expected = '.rule { font-size: 32px; font-size: 2rem }';
    var processed = pixrem(css);

    expect(processed).toBe(expected);
  });

  it('should generate fallbacks with a pixel root em value', function () {
    var expected = '.rule { font-size: 40px; font-size: 2rem }';
    var processed = pixrem(css, '20px');

    expect(processed).toBe(expected);
  });

  it('should generate fallbacks with a em root em value', function () {
    var expected = '.rule { font-size: 48px; font-size: 2rem }';
    var processed = pixrem(css, '1.5em');

    expect(processed).toBe(expected);
  });

  it('should generate fallbacks with a rem root em value', function () {
    var expected = '.rule { font-size: 56px; font-size: 2rem }';
    var processed = pixrem(css, '1.75rem');

    expect(processed).toBe(expected);
  });

  it('should generate fallbacks with a percent root em value', function () {
    var expected = '.rule { font-size: 48px; font-size: 2rem }';
    var processed = pixrem(css, '150%');

    expect(processed).toBe(expected);
  });

  it('should generate fallbacks with a unitless root em value', function () {
    var expected = '.rule { font-size: 36px; font-size: 2rem }';
    var processed = pixrem(css, '18');

    expect(processed).toBe(expected);
  });

  it('should replace rules with fallbacks when option.replace is true', function () {
    var expected = '.rule { font-size: 40px }';
    var processed = pixrem(css, '20px', { replace: true });

    expect(processed).toBe(expected);
  });

  it('should generate integer fallbacks, rounded down', function () {
    var expected = '.rule { font-size: 49px; font-size: 2rem }';
    var processed = pixrem(css, '155%');

    expect(processed).toBe(expected);
  });
});

@@ -2053,24 +2053,331 @@
 , '155%25');%0A%0A
+    expect(processed).toBe(expected);%0A  %7D);%0A%0A  it('should handle %3C 1 values and values without a leading 0', function () %7B%0A    var css = '.rule %7B margin: 0.5rem .5rem 0rem -2rem %7D';%0A    var expected = '.rule %7B margin: 8px 8px 0px -32px; margin: 0.5rem .5rem 0rem -2rem %7D';%0A    var processed = pixrem(css);%0A%0A
     expect(p

Add tests for < 0 values