Very nice, readable syntax from CSpec that alllows you to do behavior driven development with C.

#include "cspec.h"

static int nbefore_each;

describe "CSpec before_each"
  before_each
    ++nbefore_each;
  end

  it "should be called before each spec"
    nbefore_each should equal 1
  end

  it "should be called before each spec"
   nbefore_each should equal 2
  end
end

[Source on GitHub]


Have comments? Send a tweet to @TheChangelog on Twitter.

Subscribe to The Changelog Weekly – our weekly email covering everything that hits our open source radar.