Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hojberg/primrose
BDD speccing framework for YUI
https://github.com/hojberg/primrose
Last synced: 3 months ago
JSON representation
BDD speccing framework for YUI
- Host: GitHub
- URL: https://github.com/hojberg/primrose
- Owner: hojberg
- Created: 2012-10-21T21:07:12.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-23T23:07:27.000Z (about 12 years ago)
- Last Synced: 2024-04-14T19:07:53.411Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 428 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Primrose
========BDD speccing framework for YUI
# Writing a spec
```JavaScript
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
```JavaScript
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();});
```