Coder Social home page Coder Social logo

given-php's People

Contributors

thomasruiz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

digitalsadhu

given-php's Issues

Given When and Then syntax

I think it would be super nice if in the given when and then blocks, you could define a label first.

eg. Currently I have a test:

describe('Math', function () {

    context('Addition', function () {

        given('x', 2);
        given('y', 4);

        when('sum', function ($x, $y) {
            return $x + $y; 
        });

        then(function ($sum) {
            return $sum === 6;
        });

        then(function ($sum) {
            return $sum !== 5;
        });
    });

});

It would be nice to express this as:

describe('Math', function () {

    context('Addition', function () {

        given('a variable x', 'x', 2);
        given('a variable y', 'y', 4);

        when('I add x and y', 'sum', function ($x, $y) {
            return $x + $y; 
        });

        then('I should get 6', function ($sum) {
            return $sum === 6;
        });

        then('I should not get 5', function ($sum) {
            return $sum !== 5;
        });
    });

});

This reads better in the test itself and would allow you to write a formatter that reads better.

Stability question

This library looks very much like what I'm after.
How stable is it? You say it's 'pre alpha' in your docs. When do you think it might be ready for use?

If you think this is something I might be able to make use of in the near future and if you need help testing and improving documentation, I'd be happy to help out.

thanks.

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.