Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created April 15, 2016 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/7ecb36ac26c1b7a371ab7e200f1a94c1 to your computer and use it in GitHub Desktop.
Save zoffixznet/7ecb36ac26c1b7a371ab7e200f1a94c1 to your computer and use it in GitHub Desktop.
subtest {
my $res = $glot.create: 'perl6', 'say "Hello, World!"';
is $res.WHAT, Hash, 'returns a Hash';
diag "Created paste ID $res<id>";
is-deeply $res, $glot.get($res<id>), '.get fetches the snippet fine';
isa-ok $glot.delete: $res<id>, True,
'successful .delete returns True';
throws-like { $glot.delete: $res<id> }, Exception,
'delete on non-existent snippet throws',
message => /404/;
}, '.create method (Str for code)';
t/02-snippets-api.t ..
ok 1 - returns a Hash
# Created paste ID edrph6mqvi
ok 2 - .get fetches the snippet fine
Too many positionals passed; expected 2 arguments but got 4
in method delete at /home/zoffix/CPAN/GlotIO/lib/GlotIO.pm6 (GlotIO) line 168
in block <unit> at t/02-snippets-api.t line 182
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
Test Summary Report
-------------------
t/02-snippets-api.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
Files=1, Tests=0, 6 wallclock secs ( 0.08 usr 0.01 sys + 3.43 cusr 0.23 csys = 3.75 CPU)
Result: FAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment