Created
September 28, 2012 04:37
-
-
Save kwatch/3797939 to your computer and use it in GitHub Desktop.
change block arg of spec() to be optional
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
| # -*- coding: utf-8 -*- | |
| ## | |
| ## change block arg of spec() to be optional | |
| ## | |
| use strict; | |
| use warnings; | |
| use Test::More; | |
| sub spec { | |
| my ($text, $block) = @_; | |
| print "# $text\n"; | |
| return $block->() if $block; | |
| TODO: { | |
| local $TODO = ": not implemented yet"; | |
| ok(undef); | |
| } | |
| } | |
| if ($0 eq __FILE__) { | |
| use Test::More tests => 2; | |
| spec "1+1 should be 2"; | |
| spec "1+1 should be 2", sub { | |
| is(1+1, 2); | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment