2017 © Pedro Peláez
 

application omikron

Simple, functional programming style test framework

image

turanct/omikron

Simple, functional programming style test framework

  • Monday, August 31, 2015
  • by turanct
  • Repository
  • 4 Watchers
  • 25 Stars
  • 108 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Omikron Test Framework

Travis CI, (*1)

A simple, functional programming inspired, test framework., (*2)

Ouroboros, the greek dragon eating its own tail, (*3)

This project was started as a reaction to this issue and was initially a gist. It's currently not meant to be used in production, but there's nobody stopping you if you want to., (*4)

Usage

Installing it is easy, just require turanct/omikron as a development dependency in your composer.json file, and configure a bin-dir. The omikron executable will be available in your bin directory when you've run composer install., (*5)

{
    "require-dev": {
        "turanct/omikron": "dev-master"
    },
    "config": {
        "bin-dir": "bin"
    }
}

Omikron has a concept of topics, topics are distinct parts of your code under test. These topics have different features, and to describe those features, there are assertions., (*6)

<?php return

within("calculus",
    describe("addition",
        it("adds two numbers", function() { return
            expect(1 + 1, toBe(3)); // Will return false => failing test
        }),
        it("adds three numbers", function() { return
            expect(1 + 1 + 1, toBe(3));
        })
    ),
    describe("subtraction",
        it("subtracts two numbers", function() { return
            expect(3 - 2, toBe(1));
        })
    )
);

This is an example of a topic. It's in a file named topics/topic-calculus.php. Every topic file must have a name starting with topic-. You can split topics over multiple files if you want to. The topic calculus has two features, addition and subtraction, and both of those features have some assertions., (*7)

To run the tests for this topic, we'll just run bin/omikron topics (as topics is the directory with my topics). The output will be something like this:, (*8)

$ bin/omikron topics
topics: 1
features: 2
assertions: 3

FAILED: calculus: addition adds two numbers
Expected 2 to be 3

Tests

Omikron has unit tests, located in the tests directory. These tests are written using Omikron itself, so you can just run the Omikron executable on the tests dir!, (*9)

$ bin/omikron tests

Contributing

Feel free to fork and send pull requests!, (*10)

The Versions

31/08 2015

dev-master

9999999-dev http://github.com/turanct/omikron

Simple, functional programming style test framework

  Sources   Download

MIT

The Requires

 

31/08 2015

0.6.0

0.6.0.0 http://github.com/turanct/omikron

Simple, functional programming style test framework

  Sources   Download

MIT

The Requires

 

15/03 2015

0.5.0

0.5.0.0 http://github.com/turanct/omikron

Simple, functional programming style test framework

  Sources   Download

MIT

The Requires

 

26/02 2015

0.4.0

0.4.0.0 http://github.com/turanct/omikron

Simple, functional programming style test framework

  Sources   Download

MIT

The Requires

 

22/02 2015

0.3.0

0.3.0.0 http://github.com/turanct/omikron

Simple, functional programming style test framework

  Sources   Download

MIT

The Requires

 

22/02 2015

0.2.0

0.2.0.0 http://github.com/turanct/omikron

Simple, functional programming style test framework

  Sources   Download

MIT

21/02 2015

0.1.1

0.1.1.0 http://github.com/turanct/omikron

Simple, functional programming style test framework

  Sources   Download

MIT

20/02 2015

0.1.0

0.1.0.0 http://github.com/turanct/omikron

Simple, functional programming style test framework

  Sources   Download

MIT