Skip to content

Instantly share code, notes, and snippets.

@VoQn
Created July 12, 2012 15:54
Show Gist options
  • Select an option

  • Save VoQn/3098992 to your computer and use it in GitHub Desktop.

Select an option

Save VoQn/3098992 to your computer and use it in GitHub Desktop.
macchiato.js-v0.2.0 feature
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
@VoQn
Copy link
Copy Markdown
Author

VoQn commented Jul 12, 2012

BDD 部分と ランダムテスト部分を統合させたいんですよ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment