Permalink
Browse files

minimal test for RT61177

  • Loading branch information...
DrHyde committed Sep 10, 2010
1 parent 0dd2845 commit ac459d92a756bfd7c727d6973da5618811428b2d
Showing with 16 additions and 0 deletions.
  1. +16 −0 t/902_bugfix-rt61177.t
View
@@ -0,0 +1,16 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use Number::Phone;
+
+use Test::More tests => 6;
+
+ok(Number::Phone->new("442087712924")->country_code() == 44, "known countries return objects");
+ok(Number::Phone->new("+442087712924")->country_code() == 44, "known countries with a + return objects");
+
+foreach my $prefix ('', '+') {
+ my $object = Number::Phone->new($prefix."491774497319");
+ isa_ok($object, 'Number::Phone', "unknown countries return minimal objects".($prefix? " with a +" : ""));
+ ok($object->country_code() == 49, "->country_code works");
+}

0 comments on commit ac459d9

Please sign in to comment.