Giter VIP home page Giter VIP logo

dfect's Introduction

gsinclair/dfect
===============

Fork by Gavin Sinclair of Suraj N. Kurapati's 'dfect' testing library.

Things I like about dfect: simplicity, minimalism, good design.

Things I want to implement, with progress reports:

 * Minimal but useful output with meaningful failure messages
     - Completed in most/all cases; see below.
     - When asserting equality between two long strings, the _difference_
       between them is indicated for easier debugging.

 * Colourful output
     - Completed in most/all cases.

 * (A few) more assertions, like Eq for asserting equality
     - The following are implemented (test/unit equivalent in brackets):
        + Eq (assert_equal)
        + N  (assert_nil)
        + Mt (assert_match)
     - More to come as I need/want them.  Not aiming to add everything
       under the sun, though!

 * Facility for user-added assertions
     - No work done on this.

 * Easily select the tests you want to run
     - No work done on this.

 * Easily run the debugger when certain tests are executing
     - The global variable $dfect_test is set to the description of the
       currently-running test, meaning you can insert a line into your
       code like this:
          debugger if $dfect_test =~ /generate HTML/


Output
------

Here is a "screenshot" of a test failure in the project I'm working on.
Unfortunately it doesn't show the colour, which makes it much easier to read.
See links [1]-[3] below for true screenshots showing the colour.

    FAIL: TopicDocument (resources)
        ./test/topic_document.rb
           53   Eq r[0].category,     "F"
           54   Eq r[0].filetype,     "PDF"
        => 55   Eq r[0].file_re,      /^A030.+worksheet/
           56   Eq r[0].description, %{
           57     A summary of (nearly?) all the skills taught in this topic.
      Equality test failed
        Was: /^A030.+worksheet.pdf/
        Exp: /^A030.+worksheet/
      Backtrace
        ./test/topic_document.rb:55
        test/_all.rb:19


[1] http://picasaweb.google.com/lh/photo/WyrF7D7I4sKnSNCz0RlBJw
[2] http://picasaweb.google.com/lh/photo/N8kCnZ3U3wFqKBKKJM9Crg
[3] http://picasaweb.google.com/lh/photo/7r2o1HWCjyEOhjc7o1nluQ


Contact
-------

gsinclair at gmail dot com

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.