Giter Site home page Giter Site logo

codewars-rackunit's Introduction

codewars-rackunit

Wrapping Rackunit test result for Codewars.

This package contains a module codewars/rackunit, providing a function run-tests. It wraps the rackunit's check, makes the test output fit in (a subset of) Codewars output format.

Install

raco pkg install https://github.com/Codewars/codewars-rackunit.git

Usage

run-tests takes 2 arguments, test and an optional keyword #:mode argument mode. In other words, it looks like (run-tests test #:mode [mode]).

The test argument is a test-suite? or test-case? value. It is the test run.

The mode argument decides how the result be outputed. It can be one of 'quiet, 'simple, 'all or be a list of symbols. Each kind of value corresponds to a mode of the output:

The quiet mode is the default value for mode. In this mode, output looks like "Expected ***, but instead got ***". If the check has message, the message is shown in the next line.

The other 3 mode display the result more RackUnit-like. They display mode-specific check-infos line by line. The simple mode displays the name, message, actual and expected infos. The all mode displays all the check-infos.

When mode is a list of symbols, it is used as a filter for the names of check-info stack. You can use this mode to do some customization.

Some Notes

run-tests here is just a wrapper for the result of RackUnit's tests. Please read RackUnit document to get more information about RackUnit and its api.

If you want to customize the result output, use define-check and with-check-info to add custom infos; and the custom mode of run-tests to display the info you need.

A wrapper function for custom check will break the location check-info of checks. If you need location information displayed, please use define-check or a wrapper macro.

codewars-rackunit's People

Contributors

yfzhe avatar kazk avatar

Watchers

James Cloos 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.