Giter Site home page Giter Site logo

pombredanne / true Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oddbird/true

0.0 2.0 0.0 337 KB

Sass unit tests

Home Page: ericsuzanne.com/true/

License: BSD 3-Clause "New" or "Revised" License

Ruby 14.96% Makefile 0.74% JavaScript 31.71% CSS 52.60%

true's Introduction

True

Build Status

Verb

  1. To make true; shape, adjust, place, etc., exactly or accurately: True the wheels of a bicycle after striking a pothole.
  2. To make even, symmetrical, level, etc. (often followed by up): True up the sides of a door.
  3. To test your Sass code; debug, perfect, etc. (often using True): True your sweet plugin before you deploy.

At this point True can only test values (e.g. function returns), not property/value output (e.g. mixin output).

Install

in command line:

# ruby gem
gem install true

# bower package
bower install true

Command Line

true-cli [options] PATH

Options:

  • -s silent
  • -c config file
  • -d debug config file settings

Config file (optional):

options:
  color: true #enables colored output

# require ruby sass extension libraries
require:
  - "compass"
  - "serialy_sassy"

default location: test/true.yml

Usage

@import "true";

@include test-module('Utilities') {

  @include test('Map Add [function]') {
    $base: (one: 1, two: 1, three: 1);
    $add: (one: 1, two: 2, three: -1);

    $test: map-add($base, $add);
    $expect: (one: 2, two: 3, three: 0);
    @include assert-equal($test, $expect,
      'Returns the sum of two numeric maps');
  }

  @include test('Is Equal [function]') {
    $test: is-equal(1, 1rem);
    @include assert-equal($test, false,
      'Returns false for equal numbers with different units.');

    $test: is-equal(1, 1);
    @include assert-equal($test, true,
      'Returns true for numbers that are truely equal.');
  }
}

@include report;

Settings

There is only one setting. $true-terminal-output controls what output (if any) is shown in the terminal. The default setting is true, which will show warnings in the terminal when an assertion fails. You can set it to false to turn off all terminal output, or details to show more @debug info on failures, and a final summary of the results.

  • LibSass doesn't support @debug.
  • The Ruby CLI requires the final summary output.

true's People

Contributors

antife-yinyue avatar carljm avatar chriseppstein avatar mirisuzanne avatar scottdavis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.