fluent-asserts-vibe 0.1.3

Fluent assertions for Vibe.d


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Build Status Line Coverage DUB Version DUB Installs

There are a lot of ways in which you can test an web api. Unfortunately, vibe.d does not come with utilities that allows us to write simple and nice tests. This is a library that improves your testing experience by extending the fluent-asserts library.

To begin

  1. Add the DUB dependency: https://code.dlang.org/packages/fluent-asserts

  2. Import it:

    in dub.json:

        ...
        "configurations": [
            ...
            {
                "name": "unittest",
                "dependencies": {
                    "fluent-asserts-vibe": "~>0.1.0",
                    ...
                }
            },
            ...
        ]
        ...
    

    in your source files:

    version(unittest) import fluent.asserts.vibe;
    
  3. Use it:

    unittest {
        auto request = new RequestRouter(router);

        request
            .get("/")
            .end((Response response) => {
                response.bodyString.should.not.equal("hello");
            });
    }

    unittest {
        Assert.equal(true, false, "this is a failing assert");
    }
  1. Run the tests:
➜  dub test --compiler=ldc2

API Docs

The full documentation of the fluent-asserts can be found at: http://fluentasserts.szabobogdan.com/

License

MIT. See LICENSE for details.

Authors:
  • Szabo Bogdan
Dependencies:
vibe-d:data, fluent-asserts, vibe-d:http
Versions:
0.1.3 2020-Jul-02
0.1.2 2020-Apr-02
0.1.1 2020-Apr-02
0.1.0 2020-Apr-02
~master 2020-Jul-02
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 12 downloads this week

  • 135 downloads this month

  • 1289 downloads total

Score:
0.7
Short URL:
fluent-asserts-vibe.dub.pm