BDD speccing framework for YUI
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
build/gallery-primrose
src/primrose
.gitignore
README.md

README.md

Primrose

BDD speccing framework for YUI

Writing a spec

YUI.add('user-spec', function (Y) {
  var P           = Y.Primrose,
      describe    = P.describe,
      it          = P.it,
      beforeEach  = P.beforeEach;

  describe('User', function () {

    var subject;

    beforeEach(function () {
      subject = new Y.User({ 
        firstname: 'Simon', 
        lastname: 'Højberg' 
      });
    });

    describe('name', function () {
      it('combines first and last names', function (expect) {
        expect( subject.get('name') ).toBe( 'Simon Højberg' );
      });
    });

  });

}, '0.0.1', { requires: ['user' /* module to test */, 'primrose'] });

Running all specs

YUI().use('user-spec', 'primrose', 'primrose-log-reporter', function (Y) {

  // Set a reporter
  Y.Primrose.addReporter(new Y.Primrose.LogReporter());

  // Run the specs
  Y.Primrose.run();

});