Browse Source

Add tests for get_currencies_for_country

pull/1/head
David D Lowe 6 years ago
parent
commit
72082aa5a2
  1. 1
      MANIFEST
  2. 2
      lib/Data/MoneyCurrency.pm
  3. 21
      t/get_currencies_for_country.t

1
MANIFEST

@ -6,6 +6,7 @@ MANIFEST.SKIP
README
LICENSE
t/00-load.t
t/get_currencies_for_country.t
t/get_currency.t
t/manifest.t
t/pod-coverage.t

2
lib/Data/MoneyCurrency.pm

@ -7,7 +7,7 @@ use utf8;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(get_currency);
our @EXPORT_OK = qw(get_currency get_currencies_for_country);
use File::ShareDir qw(dist_file);
use JSON qw(decode_json);

21
t/get_currencies_for_country.t

@ -0,0 +1,21 @@
#!perl -T
use 5.006;
use strict;
use warnings;
use utf8;
use Test::More;
use Test::Exception;
use Data::MoneyCurrency qw(get_currencies_for_country);
binmode STDOUT, ":encoding(UTF-8)";
binmode STDERR, ":encoding(UTF-8)";
binmode Test::More->builder->output, ":encoding(UTF-8)";
binmode Test::More->builder->failure_output, ":encoding(UTF-8)";
binmode Test::More->builder->todo_output, ":encoding(UTF-8)";
is_deeply(get_currencies_for_country('fr'), ['eur'], 'Test France');
is_deeply(get_currencies_for_country('us'), ['usd'], 'Test USA');
is_deeply(get_currencies_for_country('cu'), ['cuc', 'cup'], 'Test Cuba');
done_testing();
Loading…
Cancel
Save