Skip to content

Instantly share code, notes, and snippets.

@rjattrill
Last active December 15, 2015 12:29
Show Gist options
  • Save rjattrill/5260941 to your computer and use it in GitHub Desktop.
Save rjattrill/5260941 to your computer and use it in GitHub Desktop.
Unit Test Template
use Test::More;
use v5.10;
use Carp;
use Try::Tiny;
use Data::Dumper;
use FindBin qw($Bin);
use FindBin::libs;
our $username = 'unit_test';
BEGIN {
use_ok(MySpace::NewService);
}
SKIP:
{
my $test = 'Setup';
skip "Debugging", 1, if 0;
try {
say "Running $test";
my $yaml = "$Bin/../../../data/MySpace/NewServiceUnitTestSet.yaml";
ok(-e $yaml, "YAML file exists");
my $s = MySpace::NewService->new(username => $username);
my $rc = $s->load_yaml($yaml);
ok($rc, "load_yaml");
} catch {
carp($_);
fail($test);
}
}
SKIP:
{
my $test = 'Next test';
skip "Debugging", 1, if 0;
try {
...
}
}
done_testing();
@rjattrill
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment