### ----------------------------------------------------
### -- META::constants
### -- Licenses: Artistic-2.0
### -- Authors: Elizabeth Mattijsen
### -- File: t/01-basic.rakutest
### ----------------------------------------------------
use Test;

my constant %META =
  name        => "frobnicate",
  description => "to foo the bar very well",
  version     => "42.666",
  api         => "137",
  auth        => "zef:scoobydoo",
  authors     => ("Scooby-Doo", "Velma Dinkley"),
  source-url  => "https://github.com/lizmat/META-constants.git",
;

class ProvideMeta { method meta() { %META } }

use META::constants ProvideMeta;

plan 17;

is-deeply NAME,        %META<name>,               'is NAME ok';
is-deeply DESCRIPTION, %META<description>,        'is DESCRIPTION ok';
is-deeply VERSION,     %META<version>.Version,    'is VERSION ok';
is-deeply API,         %META<api>,                'is API ok';
is-deeply AUTH,        %META<auth>,               'is AUTH ok';
is-deeply AUTHORS,     %META<authors>.join(', '), 'is AUTHORS ok';
is-deeply SOURCE-URL,  %META<source-url>.chop(4), 'is SOURCE-URL ok';
ok CREDITS,                                       'are there CREDITS';
is-deeply META,        %META,                     'is META ok';

{
    use META::constants Nil;
    is-deeply NAME,        "",         'is no NAME ok';
    is-deeply DESCRIPTION, "",         'is no DESCRIPTION ok';
    is-deeply VERSION,     "".Version, 'is no VERSION ok';
    is-deeply API,         "",         'is no API ok';
    is-deeply AUTH,        "",         'is no AUTH ok';
    is-deeply AUTHORS,     "",         'is no AUTHORS ok';
    is-deeply SOURCE-URL,  "",         'is no SOURCE-URL ok';
    is-deeply CREDITS,     "",         'is no CREDITS ok';
}

# vim: expandtab shiftwidth=4


