Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'lib/Lambda.php';
- require 'lib/shortcuts.php';
- function describe($context, $examples) {
- $instance = new stdClass;
- if (isset($examples['before']) && $before = $examples['before'])
- unset($examples['before']);
- if (isset($examples['after']) && $after = $examples['after'])
- unset($examples['after']);
- $before->call($instance);
- foreach ($examples as $description => $example) {
- $example->call($instance);
- }
- $after->call($instance);
- print_r($instance);
- }
- class EmulateStatement { function expect() {} }
- function with() {
- return new EmulateStatement;
- }
- describe('string', array(
- 'before' => def(& $self)?
- $self = 'your mum'
- :fed(),
- 'should have a length' => def(& $self)?
- print_r($self)
- :fed(),
- ));
- ?>
Add Comment
Please, Sign In to add comment