Skip to content

Instantly share code, notes, and snippets.

@kwatch
Created September 28, 2012 04:33
Show Gist options
  • Save kwatch/3797929 to your computer and use it in GitHub Desktop.
Save kwatch/3797929 to your computer and use it in GitHub Desktop.
define spec() simply
# -*- 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