vesln/seed-forge — pull request #3 by jonstorer (2014-12-03 21:20:38+00:00)
Title: Consider a factory's entire ancestry

Consider a factory's entire lineage for attributes.

I used chai's `expect` interface because `should` breaks down when running assertions against undefined or null values. I'd be willing to change it to use `should` if you'd like.

```javascript

var define = require('seed-forge').define;
var build = require('seed-forge').build;

// define User
define('User', User)
.set('email', function (n) { return 'user' + n + '@example.com'; })
.set('name', 'Fred')
.set('admin', false)
.set('disabled', false);

// define Admin
define('Admin', User).extend('User')
.set('admin', true);

// define DisabledAdmin
define('DisabledAdmin', User).extend('Admin')
.set('disabled', true);

console.log(attributes('User'));
// { email: 'user1@example.com', name: 'Fred', admin: false, disabled: false }

console.log(attributes('Admin'));
// { email: 'user2@example.com', name: 'Fred', admin: true, disabled: false }

// include attributes from all ancestors
console.log(attributes('DisabledAdmin'));
// { email: 'user3@example.com', name: 'Fred', admin: true, disabled: true }

```