Skip to content

Instantly share code, notes, and snippets.

@kwatch
Created September 28, 2012 04:37
Show Gist options
  • Select an option

  • Save kwatch/3797939 to your computer and use it in GitHub Desktop.

Select an option

Save kwatch/3797939 to your computer and use it in GitHub Desktop.
change block arg of spec() to be optional
# -*- 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