Created
July 12, 2012 15:54
-
-
Save VoQn/3098992 to your computer and use it in GitHub Desktop.
macchiato.js-v0.2.0 feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
people = require "../lib/people" | |
test_data = | |
Tom: | |
age: 15 | |
gender: people.GENDER.MALE | |
Beth: | |
age: 15 | |
gender: people.GENDER.FEMALE | |
macchiato.adds "Module people", | |
"find(name) -> person": subject people, | |
before: () -> | |
people.adds test_data | |
arbitrary("person").recipe () -> # Generator register | |
people.find combinator.elements(Object.keys test_data)() | |
examples: (topic) -> | |
[ # Examples for BDD | |
expect(topic.find).when_apply('Tom').to test_data['Tom'] | |
] | |
properties: [ # Properties for QuickCheck | |
arbitrary('person').property (person) -> | |
all(person.age).is 15 | |
.exports module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BDD 部分と ランダムテスト部分を統合させたいんですよ