Skip to content

yamadapc/bed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bed

Build Status Gitter chat Analytics


bed is a BDD testing framework for D heavily inspired by TJ Holowaychuk's Mocha (Node.js). It's still a WIP.

Current API

(heavily subject to changes - I'm looking at the dangling t param)

import bed;

int add(int x, int y)
{
  return x + y;
}

unittest
{

describe("add(x, y)", {
  it("1 + 3 = 3", {
    assert(add(1, 3) == 4);
  })

  it("1 + 10 = 4", {
    assert(add(1, 10) == 11);
  })

  it("2 + 2 = 5 (meant to fail)", {
    assert(add(2, 2) == 5, "what the hell happened?");
  })

  describe("when x is a negative number", {
    it("-10 + 2 = -8", {
      assert(add(-10, 2) == -8);
    })

    it("-2 - 2 = -5", {
      assert(add(-2, -2) == -5, "oh my!");
    });
  });
});

}

Where I am at (approximately) with the output (reporter system):

screenshot

LICENSE

This code is licensed under the MIT License. See LICENSE for more information.

About

bed is a work-in-progress BDD testing framework for D

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages