Created
September 28, 2012 04:33
-
-
Save kwatch/3797929 to your computer and use it in GitHub Desktop.
define spec() simply
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 -*- | |
## | |
## denfine spec() simply | |
## | |
use strict; | |
use warnings; | |
sub spec { | |
my ($text, $block) = @_; | |
print "# $text\n"; | |
$block->(); | |
} | |
if ($0 eq __FILE__) { | |
use Test::More tests => 2; | |
#is(1+1, 2, "1+1 should be 2"); | |
#is(1-1, 0, "1-1 should be 0"); | |
spec "1+1 should be 2", sub { | |
is(1+1, 2); | |
}; | |
spec "1-1 should be 0", sub { | |
is(1-1, 0); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment